Hello administer
In my CD .The BSP folder ,I decompressed the linux-2.6.23 .1 and patch the kernel with the folder in the cd
however ,I don't see the next500, what is wrong?? ( I install the toolchain )
I see in the netX-Linux-BSP.pdf the PTXdist .What is the function of this tool?
When I use the ADI-Blackfin dsp with uclinux when I run make menuconfig in the kernel source I can see
BF537 BF533 and so on!Then ,I can edit the the source driver code to make it fit to my chip platform!
Can you introduce the way how to develop linux driver with netX using PTX-dist??
Hi,AJ
Thank you for your reply!
But I would like to use the source code of linux in the BSP->linux->linux-2.6.23.1.tar.bz2 in the CD to develop
my project! But,when I edit the Makefile in the top folder of linux-2.6.23.1 which I have uncompressed and patched
,changes like these
ARCH ?= arm
CROSS_COMPILE ?= arm-v4t-linux-gnueabi-
I can use make menuconfig to find netx
but when I run make
there is a lot of error! Is PTXdist the only way to develop my project???
here is the error: too much!
include/linux/mm.h: In function 'virt_to_head_page':
include/linux/mm.h:318: error: 'CONFIG_PAGE_OFFSET' undeclared (first use in this function)
include/linux/mm.h:318: error: (Each undeclared identifier is reported only once
include/linux/mm.h:318: error: for each function it appears in.)
In file included from arch/arm/kernel/asm-offsets.c:14:
include/linux/mm.h: In function 'lowmem_page_address':
include/linux/mm.h:587: error: 'CONFIG_PAGE_OFFSET' undeclared (first use in this function)
include/linux/mm.h: At top level:
include/linux/mm.h:840: warning: 'regparm' attribute directive ignored
include/linux/mm.h:883: warning: 'regparm' attribute directive ignored
arch/arm/kernel/asm-offsets.c:15:27: error: asm/mach/arch.h: No such file or directory
arch/arm/kernel/asm-offsets.c:17:24: error: asm/memory.h: No such file or directory
arch/arm/kernel/asm-offsets.c:18:26: error: asm/procinfo.h: No such file or directory
arch/arm/kernel/asm-offsets.c: In function 'main':
arch/arm/kernel/asm-offsets.c:55: error: 'struct thread_info' has no member named 'cpu_domain'
arch/arm/kernel/asm-offsets.c:56: error: 'struct thread_info' has no member named 'cpu_context'
arch/arm/kernel/asm-offsets.c:57: error: 'struct thread_info' has no member named 'used_cp'
arch/arm/kernel/asm-offsets.c:58: error: 'struct thread_info' has no member named 'tp_value'
arch/arm/kernel/asm-offsets.c:59: error: 'struct thread_info' has no member named 'fpstate'
arch/arm/kernel/asm-offsets.c:60: error: 'struct thread_info' has no member named 'vfpstate'
arch/arm/kernel/asm-offsets.c:68: error: 'struct pt_regs' has no member named 'ARM_r0'
arch/arm/kernel/asm-offsets.c:69: error: 'struct pt_regs' has no member named 'ARM_r1'
arch/arm/kernel/asm-offsets.c:70: error: 'struct pt_regs' has no member named 'ARM_r2'
arch/arm/kernel/asm-offsets.c:71: error: 'struct pt_regs' has no member named 'ARM_r3'
arch/arm/kernel/asm-offsets.c:72: error: 'struct pt_regs' has no member named 'ARM_r4'
arch/arm/kernel/asm-offsets.c:73: error: 'struct pt_regs' has no member named 'ARM_r5'
arch/arm/kernel/asm-offsets.c:74: error: 'struct pt_regs' has no member named 'ARM_r6'
arch/arm/kernel/asm-offsets.c:75: error: 'struct pt_regs' has no member named 'ARM_r7'
arch/arm/kernel/asm-offsets.c:76: error: 'struct pt_regs' has no member named 'ARM_r8'
arch/arm/kernel/asm-offsets.c:77: error: 'struct pt_regs' has no member named 'ARM_r9'
arch/arm/kernel/asm-offsets.c:78: error: 'struct pt_regs' has no member named 'ARM_r10'
arch/arm/kernel/asm-offsets.c:79: error: 'struct pt_regs' has no member named 'ARM_fp'
arch/arm/kernel/asm-offsets.c:80: error: 'struct pt_regs' has no member named 'ARM_ip'
arch/arm/kernel/asm-offsets.c:81: error: 'struct pt_regs' has no member named 'ARM_sp'
arch/arm/kernel/asm-offsets.c:82: error: 'struct pt_regs' has no member named 'ARM_lr'
arch/arm/kernel/asm-offsets.c:83: error: 'struct pt_regs' has no member named 'ARM_pc'
arch/arm/kernel/asm-offsets.c:84: error: 'struct pt_regs' has no member named 'ARM_cpsr'
arch/arm/kernel/asm-offsets.c:85: error: 'struct pt_regs' has no member named 'ARM_ORIG_r0'
arch/arm/kernel/asm-offsets.c:101: error: invalid application of 'sizeof' to incomplete type 'struct machine_desc'
arch/arm/kernel/asm-offsets.c:102: error: invalid use of undefined type 'struct machine_desc'
arch/arm/kernel/asm-offsets.c:103: error: invalid use of undefined type 'struct machine_desc'
arch/arm/kernel/asm-offsets.c:104: error: invalid use of undefined type 'struct machine_desc'
arch/arm/kernel/asm-offsets.c:105: error: invalid use of undefined type 'struct machine_desc'
arch/arm/kernel/asm-offsets.c:107: error: invalid application of 'sizeof' to incomplete type 'struct proc_info_list'
arch/arm/kernel/asm-offsets.c:108: error: invalid use of undefined type 'struct proc_info_list'
arch/arm/kernel/asm-offsets.c:109: error: invalid use of undefined type 'struct proc_info_list'
arch/arm/kernel/asm-offsets.c:110: error: invalid use of undefined type 'struct proc_info_list'
Hilscher Gesellschaft für Systemautomation mbH
It compiles correctly here.
But i was able to force this error by defining wrong kernel compile option once. This results in the build process to look in the wrong directory for processor dependent header files. Seems like a glitch in the kernel build process if someone is not sure for which platform he wants to build the kernel.
Seems like you compiled it once with the wrong ARCH flag. This results in "include/asm" to be symlinked to the wrong architecture.
Make sure the symlink points to "asm-arm"
mtrensch@softwareeo:/tmp/linux-2.6.23.1$ ll include/ drwxr-xr-x 3 mtrensch users 4096 2009-02-23 07:32 acpi lrwxrwxrwx 1 mtrensch users 7 2009-02-23 07:51 asm -> asm-arm
When compiling I was using the following sequence:
- cd /tmp
- tar xjf /mnt/cdrom/bsp/linux/linux-2.6.23.1.tar.bz2
- /usr/local/lib/ptxdist-1.0.2/scripts/apply_patch_series.sh -d /tmp/linux-2.6.23.1/ -s /mnt/cdrom/bsp/linux/patches/series
- make ARCH=arm menuconfig
- export PATH=$PATH:/opt/OSELAS.Toolchain-1.1.1/arm-v4t-linux-gnueabi/gcc-4.1.2-glibc-2.5-kernel-2.6.18/bin
- make ARCH=arm CROSS_COMPILE=arm-v4t-linux-gnueabi-
Regards
MT
Thank you!
But i was able to force this error by defining wrong kernel compile option once
Can the kernel which you compiled run on your netx500 board rightly??
I compile the kernel like you however the zImage in the folder "arch/arm/boot/" can't run when I download it via
tftp 0x80000000 zImage
bootm 0x8000 0000
it report that Bad magic number
thanks to your reply
Hilscher Gesellschaft für Systemautomation mbH
I tried with the uImage and that worked ok.
make ARCH=arm CROSS_COMPILE=arm-v4t-linux-gnueabi- uImage
Output:
uboot>tftp 0x80000000 uImage
Link is up - 100/Half
TFTP from server 192.168.3.50; our IP address is 192.168.3.165
Filename 'uImage'.
Load address: 0x80000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
##########################
done
Bytes transferred = 1461672 (164da8 hex)
uboot> bootm 0x80000000
## Booting image at 80000000 ...
Image Name: Linux-2.6.23.1-rt5-ptx3-netx2
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1461608 Bytes = 1.4 MB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
OK
Starting kernel ...
Uncompressing Linux............................................................................................. done, booting
the kernel.
Regards
MT
Oh ,thank you -- MT !
I copy the uboot/tools/mkimage to /usr/bin then
make ARCH=arm CROSS_COMPILE=arm-v4t-linux-gnueabi- uImage
just like you do !It umcompressed the kernel however the kernel can't run same as you!
lack of "done, booting the kernel." It seems that the kernel is dead.
My serial consle can't send command to Uboot or kernel to control the board,I can't type one word to the console.
Sincerely thanks to you!
Link is down - 10/Half
TFTP from server 192.168.1.65; our IP address is 192.168.1.100
Filename 'uImage'.
Load address: 0x80000000
Loading: T T #################################################################
#################################################################
#################################################################
###########################################################
done
Bytes transferred = 1300256 (13d720 hex)
uboot> bootm 0x80000000
## Booting image at 80000000 ...
Image Name: Linux-2.6.23.1-rt5
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1300192 Bytes = 1.2 MB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
OK
Starting kernel ...
Uncompressing Linux.............................................................
Hilscher Gesellschaft für Systemautomation mbH
Take a look at the kernel parameters. The kernel is NOT dead.
You will need to pass the correct command line so it uses the correct serial port, etc.
These command lines are already pre-built inside the default u-boot environment. Check printenv to build your command line.
BTW: I am just asking myself, why you don't proceed, as described in the BSP documentation. Everything is already prepared. PTXDist builds u-boot, kernel, root-filesystem and all macros, kernel command line parameters, etc. are already present. Usually it's plug and play if you proceed as described in the manuals.
Regards
MT
Thank you!
I download the kernel which is made by PTXdist (images/linuximage ) to the SDRAM area 0x80000000
when I run bootm 0x80000000 ,It is done ,booting the kernel,but also no serial console message to display ,so I try to make the source code .I think it is good to learn linux,so I use it!
I set the CMDLINE as "console=ttySAC0,115200, or console=ttyNX0,115200 " There is no effect.I see the parameter in uboot is ttyNX0.
I have another question If there is no root file system image ,can the kernel boot and show "root" in the console??
Hilscher Gesellschaft für Systemautomation mbH
I set the CMDLINE as "console=ttySAC0,115200, or console=ttyNX0,115200 " There is no effect.I see the parameter in uboot is ttyNX0.
I have another question If there is no root file system image ,can the kernel boot and show "root" in the console??
When the kernel does not find a root file system it will end up in a kernel panic and starve there.
Regards
MT
I see
#define DRIVER_NAME "netx-uart"
static struct uart_driver netx_reg = {
.owner = THIS_MODULE,
.driver_name = DRIVER_NAME,
so I setenv bootargs=console=netx-uart0,115200
after that I bootm 0x80000000,just the same result-- can't see kernel console command line
I consider another problem,if the clock in Uboot is not same with linux kernel?
there is an strange appearance when I change the uImage name to uImage-netx ,the run bootcmd_net
the kernel can start but no root console!
Hilscher Gesellschaft für Systemautomation mbH
So you have probably seen this too?
static struct console netx_console = {
.name = "ttyNX",
.write = netx_console_write,
.device = uart_console_device,
.setup = netx_console_setup,
.flags = CON_PRINTBUFFER,
.index = -1,
.data = &netx_reg,
};
The console is still at ttyNX0 nothing else. Maybe you just did not include all needed drivers in your kernel configuration? Just a guess, as you are building the kernel by hand.
I consider another problem,if the clock in Uboot is not same with linux kernel?
there is an strange appearance when I change the uImage name to uImage-netx ,the run bootcmd_net
the kernel can start but no root console!
I am not quite sure, why you assume a clock error here? You won't get a console to login without a root filesystem.
Regards
MT
now it show that cannot open device" nfs" or unknown block (0,255) kernel panic
please append a correct "root=" boot option
I have copy the root folder in PTXdist project to my nfs share folder,and config File system -> network file system ->NFS FILE SYSTEM support in the menuconfig
Hilscher Gesellschaft für Systemautomation mbH
You are missing the root file system. Just enabling NFS support in the kernel is not sufficient. You will need to pass parameters to tell the kernel on which server (and where) the root file system can be found.
There should be additional kernel output, where it expects the root filesystem and what IP address it is using. Usually it uses DHCP.
Regards
MT
:)
now I it have mounted NFS file system however it still stopped! What is the problem?It seems that the filesystem is not run
now I try to use busybox to make a new filesystem ,last time the root filesystem is made by PTXdist,
[ 1.520000] Serial: NetX driver
[ 1.520000] netx-uart netx-uart.0: initialising
[ 1.530000] netx-uart.0: ttyNX0 at MMIO 0x100a00 (irq = 8) is a NETX
[ 1.540000] netx-uart netx-uart.1: initialising
[ 1.540000] netx-uart.1: ttyNX1 at MMIO 0x100a40 (irq = 9) is a NETX
[ 1.550000] netx-uart netx-uart.2: initialising
[ 1.550000] netx-uart.2: ttyNX2 at MMIO 0x100a80 (irq = 10) is a NETX
[ 1.580000] RAMDISK driver initialized: 16 RAM disks of 65536K size 1024 blocksize
[ 1.590000] NetX Ethernet driver
[ 1.600000] eth%d: assume firmware version 1007
[ 1.600000] eth%d: assume firmware version 1007
[ 1.610000] mice: PS/2 mouse device common for all mice
[ 1.620000] NET: Registered protocol family 1
[ 2.140000] eth0: link down
[ 2.140000] eth1: link down
[ 3.150000] Sending DHCP requests .<6>eth0: link up, 10Mbps, half-duplex, lpa 0x0021
[ 6.490000] ., OK
[ 6.540000] IP-Config: Got DHCP answer from 0.0.0.0, my address is 192.168.1.128
[ 6.570000] IP-Config: Complete:
[ 6.570000] device=eth0, addr=192.168.1.128, mask=255.255.255.0, gw=192.168.1.252,
[ 6.580000] host=192.168.1.128, domain=, nis-domain=(none),
[ 6.580000] bootserver=0.0.0.0, rootserver=192.168.1.65, rootpath=
[ 6.590000] Looking up port of RPC 100003/3 on 192.168.1.65
[ 6.610000] Looking up port of RPC 100005/3 on 192.168.1.65
[ 9.590000] VFS: Mounted root (nfs filesystem).
[ 9.590000] Freeing init memory: 116K
Hilscher Gesellschaft für Systemautomation mbH
now I it have mounted NFS file system however it still stopped! What is the problem?It seems that the filesystem is not run
now I try to use busybox to make a new filesystem ,last time the root filesystem is made by PTXdist,
Sure that your "nfsroot" kernel parameter points to the correct location and all access rights are correct? nfsroot parameter must look like that (and be included in your "bootargs" uboot environment variable):
nfsroot=192.168.3.165:/srv/nfs4/myrootfs
And the root filesystem must contain everything needed for bootup of the kernel.
You may take a look at the nfs log files on your host, so see if everything has been mounted correctly.
[ 6.540000] IP-Config: Got DHCP answer from 0.0.0.0, my address is 192.168.1.128
Strange setup you got there. IP 0.0.0.0 shouldn't be valid IMHO.
Regards
MT
now I try to use jffs2 file system
I set bootoption as: root=/dev/mtdblock3 rootfstype=jffs2 ,and choose the jffs2 and MTD support
in the kernel make menuconfig ,use the root.jffs2 file in the cd ,run prg_jffs2 however ,the kernel panic why??
Thank you for you help MT!
1.540000] RAMDISK driver initialized: 16 RAM disks of 65536K size 1024 blocksize
[ 1.550000] NetX Ethernet driver
[ 1.560000] eth%d: assume firmware version 1007
[ 1.560000] eth%d: assume firmware version 1007
[ 1.580000] mice: PS/2 mouse device common for all mice
[ 1.580000] NET: Registered protocol family 1
[ 1.590000] List of all partitions:
[ 1.590000] No filesystem could mount root, tried: jffs2
[ 1.600000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 1.610000] [
[ 1.620000] [
[ 1.630000] r3:00000000 r2:c0375f0c r1:c0375f0c r0:c024c7a8
[ 1.630000] [
[ 1.640000] [
[ 1.650000] r5:c001f8b8 r4:c02900c8
[ 1.650000] [
[ 1.660000] r5:00000000 r4:c02900b8
[ 1.670000] [
Hilscher Gesellschaft für Systemautomation mbH
now I try to use jffs2 file system
I set bootoption as: root=/dev/mtdblock3 rootfstype=jffs2 ,and choose the jffs2 and MTD support
in the kernel make menuconfig ,use the root.jffs2 file in the cd ,run prg_jffs2 however ,the kernel panic why??
Where should the kernel know mtdblock3 from? You will need to parse the mtd specification/partition on the command line as well.
See here:
CONFIG_MTD_CMDLINE_PARTS: Command line partition table parsing
Example (Taken from the BSP documentation rev. 5, page 29):
mtdparts=physmap-flash.0:128k(uboot)ro,128k(env),1536k(kernel),-(jffs2)
Regards
MT
Dear MT:
Is there anything else to choose :
I have set boot option root=/dev/mtdblock3 rootfstype=jffs2 mtdparts=physmap-flash.0:128k(uboot)ro,128k(env),1536k(kernel),-(jffs2)
but the result is the same! :( , when I choose the Redboot ,no effect!
this is my choice:
[*] MTD partitioning support │ │
< > RedBoot partition table parsing │ │
[*] Command line partition table parsing │ │
< > ARM Firmware Suite partition parsing │ │
--- User Modules And Translation Layers │ │
<*> Direct char device access to MTD devices │ │
--- Common interface to block layer for MTD 'translation layers' │ │
<*> Caching block device access to MTD devices │ │
<*> FTL (Flash Translation Layer) support
RAM/ROM/Flash chip drivers
<*> Detect flash chips by Common Flash Interface (CFI) probe │ │
< > Detect non-CFI AMD/JEDEC-compatible flash chips │ │
[ ] Flash chip driver advanced configuration options │ │
<*> Support for Intel/Sharp flash chips │ │
< > Support for AMD/Fujitsu flash chips │ │
< > Support for ST (Advanced Architecture) flash chips │ │
< > Support for RAM chips in bus mapping │ │
<*> Support for ROM chips in bus mapping │ │
< > Support for absent chips in bus mapping │ │
Mapping drivers for chip access --->
[*] Support non-linear mappings of flash chips │ │
<*> CFI Flash device in physical memory map │ │
(0xc0040000) Physical start address of flash mapping │ │
(0x20000000) Physical length of flash mapping │ │
(2) Bank width in octets │ │
< > CFI Flash device mapped on ARM Integrator/P720T │ │
< > Map driver for platform device RAM (mtd-ram)
and this is the result:
I NetX Ethernet driver
[ 1.560000] eth%d: assume firmware version 1007
[ 1.570000] eth%d: assume firmware version 1007
[ 1.580000] physmap platform flash device: 02000000 at c0000000
[ 1.590000] physmap-flash.0: Found 2 x16 devices at 0x0 in 32-bit bank
[ 1.590000] Intel/Sharp Extended Query Table at 0x0031
[ 1.600000] Using buffer write method
[ 1.600000] cfi_cmdset_0001: Erase suspend on write enabled
[ 1.610000] RedBoot partition parsing not available
[ 1.610000] ftl_cs: FTL header not found.
[ 1.620000] physmap-flash.0: failed to claim resource 0
[ 1.630000] mice: PS/2 mouse device common for all mice
[ 1.640000] NET: Registered protocol family 1
[ 1.650000] List of all partitions:
[ 1.650000] 1f00 32768 mtdblock0 (driver?)
[ 1.650000] No filesystem could mount root, tried: jffs2
[ 1.660000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 1.670000] [
Hilscher Gesellschaft für Systemautomation mbH
Use kernelconfig.target from the BSP as reference. This is a working kernel configuration.
MTD configuration options extracted from kernelconfig.target:
CONFIG_MTD=y # CONFIG_MTD_DEBUG is not set # CONFIG_MTD_CONCAT is not set CONFIG_MTD_PARTITIONS=y # CONFIG_MTD_REDBOOT_PARTS is not set CONFIG_MTD_CMDLINE_PARTS=y # CONFIG_MTD_AFS_PARTS is not set#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
# CONFIG_MTD_CFI_STAA is not set
CONFIG_MTD_CFI_UTIL=y
CONFIG_MTD_RAM=y
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not setCONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_START=0x8000000
CONFIG_MTD_PHYSMAP_LEN=0x0
CONFIG_MTD_PHYSMAP_BANKWIDTH=0
Regards
MT
Andreas Jacob
Hilscher Gesellschaft fuer Systemautomation mbH
Hi wangl,
the PTXdist is used to create the netX toolchain, kernel image and the root file system.
On the CD into the folder documentation you should also find a folder named ptxdist. There you will find a lot of useful manuals.