[Linux-Xtensa] Re: [patch 0/8] xtensa: s6000 & s6105 - Git Repo
Pulled; will try to merge early next week and get back to ya.
linux-xtensa at linux-xtensa.org
linux-xtensa at linux-xtensa.org
Tue Mar 31 03:15:50 PDT 2009
Johannes Weiner wrote:
...
>> What's you proposal?
>
> Sounds terrific. I wish you had told us this plan before, that would
> have saved us quite some discussion ;)
Actually I thought I had. Looks like I mentioned at least some of it to Dr. Seele,
Chris Zankel, and Marc last Wed 03/25/2009 but unfortunately didn't include
ya on that discussion as I had thought:
-------------------------------------------------------------------------
> It would be a convenient time and place to go over the merging of
> our Xtensa repositories, discuss any issues, and hopefully plain
> on pushing our work up steam to Chris's linux-next repository.
------------------------------------------------------------------------------
>
> So please let us know where to find the merged tree when it's ready.
> We will test it on our S6000 board and look over your work.
The problem I was having yesterday was a software/hardware mismatch
from the work I was doing on 2.6.27-smp.
Today I had to fix the Xtensa Kconfig, when I tested your git repo I recall it also had
the "Platform Options" missing. I also had a problem with a sed macro in our
Kernel Makefile changes that was no longer working; that's also fine now.
You may want to look the merged ones I'm now working with.
I'm currently getting a problem with your memory Zone changes;
getting an exception went it's cleared.
#0 memset () at arch/xtensa/lib/memset.S:46
#1 0xd02b392d in init_bootmem_core (bdata=0xd02c03b8, mapstart=0x0, start=0x0, end=0x4000) at mm/bootmem.c:108
#2 0xd02b398a in init_bootmem_node (pgdat=0xd02921e0, freepfn=0x0, startpfn=0x0, endpfn=0x4000) at mm/bootmem.c:128
#3 0xd02b1e20 in bootmem_init () at arch/xtensa/mm/init.c:162
#4 0xd02b1846 in setup_arch (cmdline_p=0xd02adfd0) at arch/xtensa/kernel/setup.c:462
#5 0xd02b0a09 in start_kernel () at init/main.c:559
#6 0xd0001111 in _startup () at arch/xtensa/kernel/head.S:284
The area in 1st page can't be cleared on a platform with a full MMU.
Problem was bit nasty to uncover due to the dispatch table not having been set up yet;
something I'd really like fix. Joe Taylor deferred the initialization of the
exception dispatch table while makeing it per_cpu.
(gdb) print *bdata
$49 = {
node_min_pfn = 0x0,
node_low_pfn = 0x4000,
node_bootmem_map = 0x0,
last_end_off = 0x0,
hint_idx = 0x0,
list = {
next = 0x0,
prev = 0x0
}
}
I have to start getting up earlier, meeting with Dr. Cord Seele et. al. on Wends at 10:00am;
so I'll delay fixing it till tomorrow. It's likely very easy; like skipping PAGE 0.
The memory changes and the IRQ changes are the most risky. I discussed the VARIANT change with
Marc this afternoon with a Makefile now being required for a Variant. We were wondering why you
don't put this code in the platform dir. Seem Chris Zankel's philosophy was that the platform
directory should be as tight as possible.
I like the way your handling interrupt distribution. Once we are up I'll consider
doing ours more like yours.
Marc and I looked a bit at the ARM and MIPS arch in search of the correct paradigm
for VARIANT code.
Perhaps you could start a discussion with Marc on this while I get the
merge running on LX60 and LX200; hopefully tomorrow. Marc is an early
riser, east coast time, I suspect that he likely will be on line before
you take off in Germany and might enjoy discussing the VARIANT code issue
with ya. He has a extremely in depth and long time horizon on the Xtensa
architecture.
-piet
-------------- next part --------------
# arch/xtensa/Kconfig:
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
mainmenu "Linux/Xtensa Kernel Configuration"
config ZONE_DMA
def_bool y
config XTENSA
def_bool y
select HAVE_IDE
select HAVE_ARCH_KGDB
help
Xtensa processors are 32-bit RISC machines designed by Tensilica
primarily for embedded systems. These processors are both
configurable and extensible. The Linux port to the Xtensa
architecture supports all processor configurations and extensions,
with reasonable minimum requirements, including the Diamond 232L
Standard Core. The Xtensa Linux project has
a home page at <http://www.linux-xtensa.org/>.
config RWSEM_XCHGADD_ALGORITHM
def_bool y
config GENERIC_FIND_NEXT_BIT
def_bool y
config GENERIC_HWEIGHT
def_bool y
config GENERIC_HARDIRQS
def_bool y
config GENERIC_GPIO
def_bool y
config ARCH_HAS_ILOG2_U32
def_bool n
config ARCH_HAS_ILOG2_U64
def_bool n
config NO_IOPORT
def_bool y
config IRQ_PER_CPU
def_bool y
config HZ
int
default 100
config GENERIC_TIME
def_bool y
source "init/Kconfig"
source "kernel/Kconfig.freezer"
config MMU
def_bool n
config VARIANT_IRQ_SWITCH
def_bool n
menu "Xtensa Processor type and features"
choice
prompt "Xtensa Processor Configuration"
default XTENSA_VARIANT_FSF
config XTENSA_VARIANT_FSF
bool "fsf - default (not generic) configuration"
select MMU
config XTENSA_VARIANT_MMUBASELE
bool "mmubasele - base little-endian processor configuration"
help
This variant refers to a base little-endian processor configuration (mmubasele)
that is a subset of the Diamond 232L Standard cores.
config XTENSA_VARIANT_DC232A
bool "dc232a - Diamond 232L Standard Core Rev.A (LE)"
help
This variant refers to Tensilica's Diamond 232L Standard core Rev.A (LE).
config XTENSA_VARIANT_DC232B
bool "dc232b - Diamond 232L Standard Core Rev.B (LE)"
select MMU
help
This variant refers to Tensilica's Diamond 232L Standard core Rev.B (LE).
config XTENSA_VARIANT_S6000
bool "fsf - default (not generic) configuration"
select VARIANT_IRQ_SWITCH
select ARCH_REQUIRE_GPIOLIB
config XTENSA_VARIANT_CUSTOM
bool "Custom Xtensa processor configuration"
help
Select this variant to use a custom Xtensa processor configuration.
You will be prompted for a processor variant name.
endchoice
config XTENSA_VARIANT_CUSTOM_NAME
string "Xtensa Processor Custom Variant Name"
depends on XTENSA_VARIANT_CUSTOM
default "CORENAME"
help
Provide the name of a custom Xtensa processor variant.
script. This same NAME selects include/asm-xtensa/variant-NAME
and the xtensa_NAME prefix for the toolchain.
config XTENSA_VARIANT_NAME
string
default "s6000" if XTENSA_VARIANT_S6000
default "dc232l" if XTENSA_VARIANT_MMUBASELE
default "dc232a" if XTENSA_VARIANT_DC232A
default "dc232b" if XTENSA_VARIANT_DC232B
default "fsf" if XTENSA_VARIANT_FSF
default XTENSA_VARIANT_CUSTOM_NAME if XTENSA_VARIANT_CUSTOM
config XTENSA_UNALIGNED_USER
bool "Unaligned memory access in user space"
help
The Xtensa architecture currently does not handle unaligned
memory accesses in hardware but through an exception handler.
Per default, unaligned memory accesses are disabled in user space.
Say Y here to enable unaligned memory access in user space.
config XTENSA_UNALIGNED_KERNEL
bool "Unaligned memory access in kernel space"
---help---
If the kernel accesses memory with a register that has
a random pointer in it usually will get an EXCCAUSE_UNALIGNED.
We don't currently have Double exception processing in the
fast_unaligned() handler and the double exceptions hide the
original problem with the kernel referencing a bogus pointer.
This functionaly is provided to support drivers that need
to use unaligned pointers. For now it's likely best to
not configure this in. With _kernel_exception now corectly
setting up the stack a conventional C backtrace will be
available to kgdb/xt-gdb.
Say Y here to enable unaligned memory access in user space.
config PREEMPT
bool "Preemptible Kernel"
default n
help
This option reduces the latency of the kernel when reacting to
real-time or interactive events by allowing a low priority process to
be preempted even if it is in kernel mode executing a system call.
Unfortunately the kernel code has some race conditions if both
CONFIG_SMP and CONFIG_PREEMPT are enabled, so this option is
currently disabled if you are building an SMP kernel.
Say Y here if you are building a kernel for a desktop, embedded
or real-time system. Say N if you are unsure.
config MATH_EMULATION
bool "Math emulation"
help
Can we use information of configuration file?
config ARCH_HAS_SMP
bool "System Supports SMP (MX)"
default y
help
This option is use to indicate that the system-on-a-chip (SOC)
supports Multiprocessing. Multiprocessor support implemented above
the CPU core definition and currently needs to be selected manually.
Multiprocessor support in implemented with external cache and
interrupt controlers. The external cache controler supports
cache coherency; thought still in the process of testing.
Currently addition cache flushs have been added to get
a SMP system to be stable under LTP test for about four days.
The MX interrupt distributer adds Interprocessor Interrupts
and causes the IRQ numbers to be increased by 4 for devices
like the open cores ethernet driver and the serial interface.
You still have to select "Enable SMP" to enable SMP on this SOC.
config SMP
bool "Enable Symmetric multi-processing support"
depends on ARCH_HAS_SMP
help
Enabled SMP Software; allows more than one CPU/CORE
to be activated during startup.
config NR_CPUS
depends on SMP
int "Maximum number of CPUs (2-32)"
range 2 32
default "4"
config XTENSA_CALIBRATE_CCOUNT
def_bool n
depends on !XTENSA_PLATFORM_LX60
help
On some platforms (XT2000, for example), the CPU clock rate can
vary. The frequency can be determined, however, by measuring
against a well known, fixed frequency, such as an UART oscillator.
config SERIAL_CONSOLE
def_bool n
config XTENSA_ISS_NETWORK
def_bool n
depends on ARCH_HAS_SMP
help
Enabled SMP Software; allows more than one CPU/CORE
to be activated during startup.
endmenu
menu "Xtensa Platform options"
choice
prompt "Xtensa System Type"
default XTENSA_PLATFORM_ISS
config XTENSA_PLATFORM_ISS
bool "ISS"
select XTENSA_CALIBRATE_CCOUNT
select SERIAL_CONSOLE
select XTENSA_ISS_NETWORK
help
ISS is an acronym for Tensilica's Instruction Set Simulator.
config XTENSA_PLATFORM_XT2000
bool "XT2000"
select XTENSA_CALIBRATE_CCOUNT
select PCI
help
XT2000 is the name of Tensilica's feature-rich emulation platform.
This hardware is capable of running a full Linux distribution.
config XTENSA_PLATFORM_S6105
bool "S6105"
select SERIAL_CONSOLE
config XTENSA_PLATFORM_LX60
bool "LX60"
select OPENCORES_ETHERNET
help
LX60 (XTAV60) is the name of the new Tensilica board.
This hardware is capable of running a full Linux distribution.
config XTENSA_PLATFORM_S56XX
bool "s56xx"
help
S5000 platform
config XTENSA_PLATFORM_CUSTOM
bool "Custom Xtensa platform"
help
Select this variant to use a custom platform.
You will be prompted for a platform name.
endchoice
config XTENSA_PLATFORM_CUSTOM_NAME
string "Custom Platform Name"
depends on XTENSA_PLATFORM_CUSTOM
default ""
config XTENSA_PLATFORM_NAME
string
default "iss" if XTENSA_PLATFORM_ISS
default "xt2000" if XTENSA_PLATFORM_XT2000
default "lx60" if XTENSA_PLATFORM_LX60
default "s5000" if XTENSA_PLATFORM_S5000
default XTENSA_PLATFORM_CUSTOM_NAME if XTENSA_PLATFORM_CUSTOM
config XTENSA_CPU_CLOCK
int "CPU clock rate [kHz]"
depends on !XTENSA_CALIBRATE_CCOUNT
default "16000"
config GENERIC_CALIBRATE_DELAY
bool "Auto calibration of the BogoMIPS value"
help
The BogoMIPS value can easily be derived from the CPU frequency.
config CMDLINE_BOOL
bool "Default bootloader kernel arguments"
config CMDLINE
string "Initial kernel command string"
depends on CMDLINE_BOOL
default "console=ttyS0,38400 root=/dev/ram"
help
On some architectures (EBSA110 and CATS), there is currently no way
for the boot loader to pass arguments to the kernel. For these
architectures, you should supply some command-line options at build
time by entering them here. As a minimum, you should specify the
memory size and the root device (e.g., mem=64M root=/dev/nfs).
config BLK_DEV_SIMDISK_COUNT
int "number of hostfile-based simulated block devices"
depends on XTENSA_PLATFORM_ISS
default 2
config SIMDISK0_FILENAME
string "Host filename for a simulated device"
depends on XTENSA_PLATFORM_ISS
default "x"
help
Attach a first simdisk to a host file. Conventionally, this file
contains a root file system.
config SIMDISK1_FILENAME
string "Host filename for a simulated device"
depends on XTENSA_PLATFORM_ISS && (BLK_DEV_SIMDISK_COUNT != 0)
default "x"
help
Another simulated disk in a host file for a buildroot-independent
storage.
config ARCH_SUPPORTS_OPROFILE
bool
default y
config ARCH_SUPPORTS_OPTIMIZED_INLINING
bool
default y
source "mm/Kconfig"
endmenu
menu "Xtensa Bus options"
config PCI
bool "PCI support" if !XTENSA_PLATFORM_LX60
depends on !XTENSA_PLATFORM_LX60
default y
help
Find out whether you have a PCI motherboard. PCI is the name of a
bus system, i.e. the way the CPU talks to the other stuff inside
your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
VESA. If you have PCI, say Y, otherwise N.
source "drivers/pci/Kconfig"
config HOTPLUG
bool "Support for hot-pluggable devices"
help
Say Y here if you want to plug devices into your computer while
the system is running, and be able to use them quickly. In many
cases, the devices can likewise be unplugged at any time too.
One well known example of this is PCMCIA- or PC-cards, credit-card
size devices such as network cards, modems or hard drives which are
plugged into slots found on all modern laptop computers. Another
example, used on modern desktops as well as laptops, is USB.
Enable HOTPLUG and build a modular kernel. Get agent software
(from <http://linux-hotplug.sourceforge.net/>) and install it.
Then your kernel will automatically call out to a user mode "policy
agent" (/sbin/hotplug) to load modules and set up software needed
to use devices as you hotplug them.
source "drivers/pcmcia/Kconfig"
source "drivers/pci/hotplug/Kconfig"
endmenu
menu "Xtensa Executable file formats"
# only elf supported
config KCORE_ELF
bool "Support for kernel core ELF format files via /proc/kcore"
depends on PROC_FS
default y
help
If you enabled support for /proc file system then the file
/proc/kcore will contain the kernel core image in ELF format. This
can be used in gdb:
$ cd /usr/src/linux ; gdb vmlinux /proc/kcore
This is especially useful if you have compiled the kernel with the
"-g" option to preserve debugging information. It is mainly used
for examining kernel data structures on the live kernel.
source "fs/Kconfig.binfmt"
endmenu
source "net/Kconfig"
source "drivers/Kconfig"
source "fs/Kconfig"
menu "Xtensa initrd options"
depends on BLK_DEV_INITRD
config EMBEDDED_RAMDISK
bool "Embeded root filesystem ramdisk into the kernel"
config EMBEDDED_RAMDISK_IMAGE
string "Filename of gzipped ramdisk image"
depends on EMBEDDED_RAMDISK
default "ramdisk.gz"
help
This is the filename of the ramdisk image to be built into the
kernel. Relative pathnames are relative to arch/xtensa/boot/ramdisk/.
The ramdisk image is not part of the kernel distribution; you must
provide one yourself.
endmenu
source "arch/xtensa/Kconfig.debug"
source "security/Kconfig"
source "crypto/Kconfig"
source "lib/Kconfig"
-------------- next part --------------
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 2001 - 2009 Tensilica Inc.
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
# Core and platform configurations
#
# Remove Quotes from Variant and Platform Names;
# as well as Extra CFLAGS if Optimized for Debugging.
#
VARIANT := $(strip $(subst ",,$(CONFIG_XTENSA_VARIANT_NAME)))#")))
PLATFORM := $(strip $(subst ",,$(CONFIG_XTENSA_PLATFORM_NAME)))#")))
DEBUG_CFLAGS := $(strip $(subst ",,$(CONFIG_CC_DEBUGGING_CFLAGS)))#")))
UTS_MACHINE := xtensa_$(VARIANT)
# temporarily until string.h is fixed
KBUILD_CFLAGS += -ffreestanding
KBUILD_CFLAGS += -pipe -mlongcalls $(DEBUG_CFLAGS)
# KBUILD_DEFCONFIG := iss_defconfig
VARIANT_DIR := $(patsubst %,arch/xtensa/variants/%/,$(VARIANT))
PLATFORM_DIR := $(patsubst %,arch/xtensa/platforms/%/,$(PLATFORM))
ifeq ($(KBUILD_SRC),)
KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(VARIANT_DIR) $(PLATFORM_DIR))
else
KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(VARIANT_DIR) $(PLATFORM_DIR))
endif
# Test for cross compiling. Allow xtensa-*-* and xtensa_<variant>-*-*
ifneq ($(SUBARCH),$(ARCH))
ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE := $(call cc-cross-prefix, \
xtensa-linux-uclibc- xtensa_$(VARIANT)-linux-uclibc- \
xtensa-linux-gnu- xtensa_$(VARIANT)-linux-gnu-)
endif
endif
# We need to have a 'variant' configured, so exclude this line for
# make config/clean/etc.
ifneq ($(strip $(VARIANT)),)
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
endif
head-y := arch/xtensa/kernel/head.o
core-y += arch/xtensa/kernel/ arch/xtensa/mm/
ifneq ($(VARIANT),)
core-y += arch/xtensa/variants/$(VARIANT)/
endif
ifneq ($(PLATFORM),)
core-y += arch/xtensa/platforms/$(PLATFORM)/
endif
libs-y += arch/xtensa/lib/ $(LIBGCC)
boot := arch/xtensa/boot
# archprepare: checkbin $(archinc)/.configured
archprepare: checkbin
#
# Test for a Xtnesa Compiler and print Significant Env Variables
# if make started with V=1
#
checkbin:
ifneq ($(strip $(VARIANT)),)
@if test "$(call cc-option-yn,-mlongcalls)" = "n" ; then \
echo '*** Default compiler does not appear to target an Xtensa core.'; \
echo '*** It didn't understand the '-mlongcalls' GCC option; \
echo '*** Please put an appropriate Xtensa toolchain on your PATH'; \
echo 'CROSS_COMPILE: $(CROSS_COMPILE) '; \
echo 'PLATFORM: $(PLATFORM) '; \
echo 'VARIANT: $(VARIANT) '; \
echo 'KBUILD_CFLAGS: $(KBUILD_CFLAGS) '; \
echo 'VARIANT_DIR: $(VARIANT_DIR) '; \
echo 'PLATFORM_DIR: $(PLATFORM_DIR) '; \
false; \
fi
@if test "$(KBUILD_VERBOSE)" != 0 ; then \
echo 'CROSS_COMPILE: $(CROSS_COMPILE) '; \
echo 'CONFIG_XTENSA_PLATFORM_NAME: $(CONFIG_XTENSA_PLATFORM_NAME) '; \
echo 'PLATFORM: $(PLATFORM) '; \
echo 'CONFIG_XTENSA_VARIANT_NAME: $(CONFIG_XTENSA_VARIANT_NAME) '; \
echo 'VARIANT: $(VARIANT) '; \
echo 'CONFIG_CC_DEBUGGING_CFLAGS: $(CONFIG_CC_DEBUGGING_CFLAGS) '; \
echo 'DEBUG_CFLAGS: $(DEBUG_CFLAGS) '; \
echo 'KBUILD_CFLAGS: $(KBUILD_CFLAGS) '; \
echo 'VARIANT_DIR: $(VARIANT_DIR) '; \
echo 'PLATFORM_DIR: $(PLATFORM_DIR) '; \
echo ''; \
true; \
fi
else
@echo '*** Xtensa core variant name cannot be empty (check config)' ; \
false
endif
drivers-$(CONFIG_OPROFILE) += arch/xtensa/oprofile/
# Update processor variant and platform symlinks if something which affects them changed.
#
# REMIND:
# Emlix folks wanted to delete this.
# $(archinc)/.configured: $(wildcard include/config/arch/*.h) include/config/auto.conf
# @echo ' SYMLINK $(archinc)/variant -> $(archinc)/variant-$(VARIANT)'
# $(Q)mkdir -p $(archinc)
# $(Q)ln -fsn $(srctree)/$(archinc)/variant-$(VARIANT) $(archinc)/variant
# @echo ' SYMLINK $(archinc)/platform -> $(archinc)/platform-$(PLATFORM)'
# $(Q)ln -fsn $(srctree)/$(archinc)/platform-$(PLATFORM) $(archinc)/platform
# @touch $@
all: zImage
zImage zImage.initrd: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $@
# CLEAN_FILES += arch/xtensa/vmlinux.lds \
# $(archinc)/platform $(archinc)/variant \
# $(archinc)/.configured
define archhelp
@echo '* zImage - Compressed kernel image'
@echo '* uImage - Compressed kernel image for U-Boot'
endef
More information about the linux-xtensa
mailing list