Re: [U-Boot] [PATCH V5 4/4] edminiv2: add mvsata_ide and cmd_ide support
-Original Message- From: Prafulla Wadaskar Sent: Tuesday, August 03, 2010 5:40 PM To: 'Albert ARIBAUD' Cc: u-boot@lists.denx.de; tanmay.upadh...@einfochips.com; Prabhanjan Sarnaik; Ashish Karkare Subject: RE: [PATCH V5 4/4] edminiv2: add mvsata_ide and cmd_ide support ...snip... Actually two things were necessary to get ide reset to work reliably: 1) adding a delay between the writes to SControl. Experimentation showed this delay should be at least 41 us on my board. I have set it to 50 us to play safe on possible HW characteristics dispersions. 2) moving the call(s) to mvsata_ide_initialize_port() from board_init() function to function ide_preinit(), which is called just before an IDE reset if CONFIG_IDE_INIT is set -- accordingly, I added ide_preinit() to openrd_base.c and defined CONFIG_IDE_INIT in kirkwood.h. Prafulla, can you try the patch attached above yours? Sure, I will try this and let you know Hi Albert It worked for me. You may post V7, then I will post my patches for Kirkwood sata support I have two more suggestion, 1. put ide_preinit function in mvsata driver, define CONFIG_IDE_PREINIT in board config file 2. pls remove the blank lines between each command in function mvsata_ide_initialize_port, it looks ugly. 3. Instead of adding fixed 41/50 usec delay between the writes to Scontrol It would be good if you can check/poll some status bit associated with IDE controller, this will make mvsata driver rock solid on any platform. Regards.. Prafulla . . Regards.. Prafulla . . If this works, then I'll backport the above fixes to orion5x/edminiv2 and post a V7 patch. Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V5 4/4] edminiv2: add mvsata_ide and cmd_ide support
Le 04/08/2010 08:08, Prafulla Wadaskar a écrit : -Original Message- From: Prafulla Wadaskar Sent: Tuesday, August 03, 2010 5:40 PM To: 'Albert ARIBAUD' Cc: u-boot@lists.denx.de; tanmay.upadh...@einfochips.com; Prabhanjan Sarnaik; Ashish Karkare Subject: RE: [PATCH V5 4/4] edminiv2: add mvsata_ide and cmd_ide support ...snip... Actually two things were necessary to get ide reset to work reliably: 1) adding a delay between the writes to SControl. Experimentation showed this delay should be at least 41 us on my board. I have set it to 50 us to play safe on possible HW characteristics dispersions. 2) moving the call(s) to mvsata_ide_initialize_port() from board_init() function to function ide_preinit(), which is called just before an IDE reset if CONFIG_IDE_INIT is set -- accordingly, I added ide_preinit() to openrd_base.c and defined CONFIG_IDE_INIT in kirkwood.h. Prafulla, can you try the patch attached above yours? Sure, I will try this and let you know Hi Albert It worked for me. Great! You may post V7, then I will post my patches for Kirkwood sata support Will do. I have two more suggestion, 1. put ide_preinit function in mvsata driver, define CONFIG_IDE_PREINIT in board config file 2. pls remove the blank lines between each command in function mvsata_ide_initialize_port, it looks ugly. Ok for 1 and 2. 3. Instead of adding fixed 41/50 usec delay between the writes to Scontrol It would be good if you can check/poll some status bit associated with IDE controller, this will make mvsata driver rock solid on any platform. I've looked up the marvell kirkwood and orion docs for such a control bit but found none. I'll look it up again, however it might help if you can find someone inside Marvell who would, and could, provide the info. Regards.. Prafulla . . Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] at91_pit: Fix AT91_PIT_MR_PIV_MASK macro
Signed-off-by: Alexander Stein alexander.st...@systec-electronic.com --- arch/arm/include/asm/arch-at91/at91_pit.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/include/asm/arch-at91/at91_pit.h b/arch/arm/include/asm/arch-at91/at91_pit.h index 5615a02..61aca79 100644 --- a/arch/arm/include/asm/arch-at91/at91_pit.h +++ b/arch/arm/include/asm/arch-at91/at91_pit.h @@ -25,7 +25,7 @@ typedef struct at91_pit { #defineAT91_PIT_MR_IEN 0x0200 #defineAT91_PIT_MR_EN 0x0100 -#defineAT91_PIT_MR_PIV_MASK(x 0x000f) +#defineAT91_PIT_MR_PIV_MASK(x) (x 0x000f) #defineAT91_PIT_MR_PIV(x) (x AT91_PIT_MR_PIV_MASK) #ifdef CONFIG_AT91_LEGACY -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] at91: Add arch_preboot_os which disables PIT in a faster way
When disabled the PIT runs until it reaches the CPIV value. The Linux PIT driver stops the PIT and waits until it stopped. This can take over 100ms. Simply stopping in u-boot isn't sufficient as the PIT will still be running when Linux is waiting until it stopped. So, we stop it in u-boot by setting the compare value to a value slightly greater than the current running counter to make the PIT stopped in short time. Signed-off-by: Alexander Stein alexander.st...@systec-electronic.com --- arch/arm/cpu/arm926ejs/at91/cpu.c | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/arm926ejs/at91/cpu.c b/arch/arm/cpu/arm926ejs/at91/cpu.c index 141a7d1..af86ee2 100644 --- a/arch/arm/cpu/arm926ejs/at91/cpu.c +++ b/arch/arm/cpu/arm926ejs/at91/cpu.c @@ -28,6 +28,7 @@ #include asm/arch/hardware.h #include asm/arch/at91_pmc.h +#include asm/arch/at91_pit.h #include asm/arch/clk.h #include asm/arch/io.h @@ -47,6 +48,20 @@ int arch_cpu_init(void) return at91_clock_init(CONFIG_SYS_AT91_MAIN_CLOCK); } +void arch_preboot_os(void) +{ + ulong cpiv; + at91_pit_t *pit = (at91_pit_t *) AT91_PIT_BASE; + + cpiv = AT91_PIT_MR_PIV_MASK(readl(pit-piir)); + + /* Disble PITC +* Add 0x1000 to current counter to stop it faster +* without waiting for wrapping back to 0 +*/ + writel(cpiv + 0x1000, pit-mr); +} + #if defined(CONFIG_DISPLAY_CPUINFO) int print_cpuinfo(void) { -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] U-Boot hangs when starting kernel
Dear scr...@baseoftrash.de, In message 1815091516.9403031.1280907775269.javamail.tomca...@mrmseu0.kundenserver.de you wrote: I want to exchange RedBoot with UBoot on a TX25 module to improve the boot time. I managed to install UBoot, but, the kernel does not start. Everything goes ok but after Starting kernel ... nothing happens (sorry I can't copy paste from the serial ter minal). It has to be a problem with UBoot, as I use the same kernel command line as before and it worked with RedBoot. This is NOT a problem with U-Boot. Versions of uBoot I tried: 2009/?? (precompiled from denx-cs.de) and latest 2010/06 (compiled myself) It's working fine here. Kernel command line: init=/linuxrc root=ubi0:rootfs rootfstype=ubifs console=ttymxc0,115200 ro panic=1 printk.time=1 ubi.mtd=1 Booting with tftpboot 0x80108000 uImage bootm 0x80108000 That's wrong. Try loading at 8100 instead: = tftp ${kernel_addr_r} ${bootfile} Using FEC_MXC device TFTP from server 192.168.1.1; our IP address is 192.168.20.16 Filename 'tx25/uImage'. Load address: 0x8100 Loading: T # ### done Bytes transferred = 1690112 (19ca00 hex) = run nfsargs addip addtty addmtd addmisc = print bootargs bootargs=root=/dev/nfs rw nfsroot=192.168.1.1:/opt/eldk-4.2-arm/arm ip=192.168.20.16:192.168.1.1:192.168.1.1:255.255.0.0:tx25:eth0:off panic=1 console=ttymxc0,115200 = imi ## Checking Image at 8100 ... Legacy image found Image Name: Linux-2.6.31-1-gbc01470 Image Type: ARM Linux Kernel Image (uncompressed) Data Size:1690048 Bytes = 1.6 MiB Load Address: 80008000 Entry Point: 80008000 Verifying Checksum ... OK = bootm ## Booting kernel from Legacy Image at 8100 ... Image Name: Linux-2.6.31-1-gbc01470 Image Type: ARM Linux Kernel Image (uncompressed) Data Size:1690048 Bytes = 1.6 MiB Load Address: 80008000 Entry Point: 80008000 Verifying Checksum ... OK Loading Kernel Image ... OK OK Starting kernel ... Uncompressing Linux.. done, booting the kernel. Linux version 2.6.31-1-gbc01470 (w...@sirius.denx.de) (gcc version 4.2.2) #1 PREEMPT Thu Jun 10 11:52:10 CEST 2010 CPU: ARM926EJ-S [41069264] revision 4 (ARMv5TEJ), cr=00053177 CPU: VIVT data cache, VIVT instruction cache Machine: Ka-Ro electronics TX25 module (Freescale i.MX25) Memory policy: ECC disabled, Data cache writeback Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128 Kernel command line: root=/dev/nfs rw nfsroot=192.168.1.1:/opt/eldk-4.2-arm/arm ip=192.168.20.16:192.168.1.1:192.168.1.1:255.255.0.0:tx25:eth0:off panic=1 console=ttymxc0,115200 PID hash table entries: 128 (order: 7, 512 bytes) Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) Memory: 32MB = 32MB total Memory: 23828KB available (3092K code, 5405K data, 120K init, 0K highmem) SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 NR_IRQS:208 MXC GPIO hardware 128 GPIOs on 4 ports MXC IRQ initialized Clock input source is 2400 CPU: 399.000MHz AHB: 133.000MHz MPLL: 532.000MHz UPLL: 240.000MHz IPG: 66.500MHz OTG: 60.000MHz LCD: 240.000MHz Console: colour dummy device 80x30 Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar ... MAX_LOCKDEP_SUBCLASSES: 8 ... MAX_LOCK_DEPTH: 48 ... MAX_LOCKDEP_KEYS:8191 ... CLASSHASH_SIZE: 4096 ... MAX_LOCKDEP_ENTRIES: 16384 ... MAX_LOCKDEP_CHAINS: 32768 ... CHAINHASH_SIZE: 16384 memory used by lock dependency info: 3615 kB per task-struct memory footprint: 1152 bytes Calibrating delay loop... 199.06 BogoMIPS (lpj=995328) Mount-cache hash table entries: 512 CPU: Testing write buffer coherency: ok NET: Registered protocol family 16 AHB clock rate: 133.000MHz SDMA clock rate: 66.500MHz Using SDMA I.API MXC SDMA API initialized bio: create slab bio-0 at 0 NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 1024 (order: 1, 8192 bytes) TCP bind hash table entries: 1024 (order: 3, 32768 bytes) TCP: Hash tables configured (established 1024 bind 1024) TCP reno registered NET: Registered protocol family 1 AUDMUX: probing NetWinder Floating Point Emulator V0.97 (double precision) JFFS2 version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc. msgmni has been set to 46 alg: No test for stdrng (krng) io scheduler noop registered io scheduler anticipatory registered (default) io scheduler deadline registered io scheduler cfq registered imx-fb imx-fb.0: i.MX Framebuffer driver Using video mode G-ETV570G0DMU-8 640x480 (640x480) Setting PCD to 7 for LCD clock 30.000MHz base clock 240.000MHz actual clock 34.285MHz
Re: [U-Boot] [PATCH] Add support for NetusG20
Dear Wolfgang Denk, thanks for your review. 2010/7/5 Wolfgang Denk w...@denx.de: Dear Claudio Mignanti, In message 1277651361-26448-1-git-send-email-c.migna...@gmail.com you wrote: Add support for the NetusG20 board by Acmesystems srl. This board is based on AT91SAM9G20 SoC. Signed-off-by: Claudio Mignanti c.migna...@gmail.com --- MAKEALL | 1 + Makefile | 3 + arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c | 5 + board/acmesystems/netusg20/Makefile | 56 +++ board/acmesystems/netusg20/config.mk | 1 + board/acmesystems/netusg20/led.c | 40 + board/acmesystems/netusg20/netusg20.c | 152 + board/acmesystems/netusg20/partition.c | 39 + include/configs/netusg20.h | 181 + 9 files changed, 478 insertions(+), 0 deletions(-) create mode 100644 board/acmesystems/netusg20/Makefile create mode 100644 board/acmesystems/netusg20/config.mk create mode 100644 board/acmesystems/netusg20/led.c create mode 100644 board/acmesystems/netusg20/netusg20.c create mode 100644 board/acmesystems/netusg20/partition.c create mode 100644 include/configs/netusg20.h Entry to MAINTAINERS missing. Ok diff --git a/Makefile b/Makefile index 87d5214..b73659f 100644 --- a/Makefile +++ b/Makefile @@ -2867,6 +2867,9 @@ at91sam9g45ekes_config : unconfig fi; @$(MKCONFIG) -a at91sam9m10g45ek arm arm926ejs at91sam9m10g45ek atmel at91 +netusg20_config: unconfig + @$(MKCONFIG) $(@:_config=) arm arm926ejs netusg20 acmesystems at91 + otc570_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm926ejs otc570 esd at91 NAK. Please rebase your patch against current code. We don't add boards to the top level Makefile any more. Add the definition to boards.cfg instead. diff --git a/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c b/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c index 77d49ab..87ec531 100644 --- a/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c +++ b/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c @@ -59,7 +59,12 @@ void at91_serial3_hw_init(void) { at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE; +#ifdef CONFIG_NETUSG20 + /* pull-up active on DRXD*/ + at91_set_a_periph(AT91_PIO_PORTB, 14, 1); +#else at91_set_a_periph(AT91_PIO_PORTB, 14, 0); /* DRXD */ +#endif at91_set_a_periph(AT91_PIO_PORTB, 15, 1); /* DTXD */ writel(1 AT91_ID_SYS, pmc-pcer); } Please do not add board specific defines to common code. If really needed, add a feature-specific #define. Something like this is better? /* DRXD */ at91_set_a_periph(AT91_PIO_PORTB, 14, CONFIG_AT91SAM9260_DRXD_PULLUP); at91_set_a_periph(AT91_PIO_PORTB, 15, 1); /* DTXD */ ... +#ifdef CONFIG_RESET_PHY_R +void reset_phy(void) +{ +#ifdef CONFIG_MACB + /* + * Initialize ethernet HW addr prior to starting Linux, + * needed for nfsroot + */ + eth_init(gd-bd); +#endif +} +#endif This doesn't look right to me. This part was copied from board/atmel/at91sam9260ek/at91sam9260ek.c +/* LED */ +#define CONFIG_AT91_LED +#define CONFIG_RED_LED AT91_PIN_PA9 /* this is the power led */ +#define CONFIG_GREEN_LED AT91_PIN_PA6 /* this is the user led */ Please use consistent code. Either ALWAYS use a TAB after a #define, or (better) always use a SPACE. ops sorry I will be more consistent Best Regards ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC][PATCH 00/19] arm: add full relocation / cache support
Hello Heiko Am 29.07.2010 12:44, schrieb Heiko Schocher: This patch series add full relocation and cache support for arm based boards. I did this for arm1136, arm_cortexa8 and arm926ejs based boards. As this change is not compatible to old code, before this can go to mainline *all* plattforms and boards have to be converted! As I don;t have access to all plattforms/ boards I need help here! Also I couldn;t test all boards, so please test and report, send bugfixes! I just tested your patch set on my version of u-boot for MB86R01 from Fujitsu (arm926ejs based SoC). This is currently not available in mainline u-boot but current patches are available here http://lists.denx.de/pipermail/u-boot/2010-August/074688.html The point is that the board doesn't boot after applying your patches and doing the changes to my board which are given at the end of this mail. The board runs through my low level init (so DDR RAM is up) and later on crashes in the first call to memset. I could not further debug this as I have to admit that I am not an expert with GDB + BDI2000 debugging. Maybe you can give me some hints what I am missing. Thanks Matthias Changes made to the board code after applying your patches: diff --git a/include/configs/jadecpu.h b/include/configs/jadecpu.h index bfc60a6..24aa23d 100644 --- a/include/configs/jadecpu.h +++ b/include/configs/jadecpu.h @@ -149,6 +149,10 @@ #define PHYS_SDRAM 0x4000 /* Start address of DDRRAM */ #define PHYS_SDRAM_SIZE0x0800 /* 128 megs */ +/* additions for new relocation code, must added to all boards */ +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM +#define CONFIG_SYS_INIT_SP_ADDR0x0100 + /* * FLASH and environment organization */ diff --git a/board/syteco/jadecpu/jadecpu.c b/board/syteco/jadecpu/jadecpu.c index 04d2f9d..bf96bcd 100644 --- a/board/syteco/jadecpu/jadecpu.c +++ b/board/syteco/jadecpu/jadecpu.c @@ -154,12 +154,18 @@ int misc_init_r(void) */ int dram_init(void) { - gd-bd-bi_dram[0].start = PHYS_SDRAM; - gd-bd-bi_dram[0].size = PHYS_SDRAM_SIZE; - + /* dram_init must store complete ramsize in gd-ram_size */ + gd-ram_size = get_ram_size((volatile void *)PHYS_SDRAM, + PHYS_SDRAM_SIZE); return 0; } +void dram_init_banksize (void) +{ + gd-bd-bi_dram[0].start = PHYS_SDRAM; + gd-bd-bi_dram[0].size = gd-ram_size; +} + int board_eth_init(bd_t *bis) { int rc = 0; ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] nios2: fix bootm error on fdt args
Applied to branch 'next' at: git://git.denx.de/u-boot-nios.git Regards, --Scott Thomas Chou wrote: We should check argv[3] only if there are enough args. Otherwise, it might cause invalid memory access fault. Signed-off-by: Thomas Chou tho...@wytron.com.tw --- arch/nios2/lib/bootm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/nios2/lib/bootm.c b/arch/nios2/lib/bootm.c index defa1fc..6d339e8 100644 --- a/arch/nios2/lib/bootm.c +++ b/arch/nios2/lib/bootm.c @@ -42,7 +42,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) if (boot_get_fdt(flag, argc, argv, images, of_flat_tree, of_size)) return 1; #endif - if (!of_flat_tree) + if (!of_flat_tree argc 3) of_flat_tree = (char *)simple_strtoul(argv[3], NULL, 16); if (of_flat_tree) initrd_end = (ulong)of_flat_tree; ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] config.mk: avoid -traditional-cpp on OS X 10.5
Dear Mike Frysinger, i have tested your patch on my old mini running 10.5.8 and it works. Am 04.08.2010 um 01:17 schrieb Mike Frysinger: Simply trying to include a basic header file like stdlib.h on OS X 10.5 and then building with -traditional-cpp fails with lots of errors like: In file included from /usr/include/stdlib.h:63, from test.c:3: /usr/include/available.h:85: error: stray '#' in program /usr/include/available.h:85: error: syntax error before numeric constant /usr/include/available.h:86: error: stray '#' in program In the past, I hadn't noticed because the old logic for these flags were restricted to Darwin running on PowerPC systems while I'm running on an Intel system. But after some recent clean ups and changes, the flag was being applied to all Darwin systems and my host tools broke. Signed-off-by: Mike Frysinger vap...@gentoo.org --- Note: i've only tested Darwin/x86 as my Darwin/ppc is having hardware trouble atm ... not sure when/if i'll get it fixed config.mk | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config.mk b/config.mk index bcda776..eb95093 100644 --- a/config.mk +++ b/config.mk @@ -68,13 +68,13 @@ ifeq ($(HOSTOS),darwin) DARWIN_MAJOR_VERSION = $(shell sw_vers -productVersion | cut -f 1 -d '.') DARWIN_MINOR_VERSION = $(shell sw_vers -productVersion | cut -f 2 -d '.') -before-snow-leopard = $(shell if [ $(DARWIN_MAJOR_VERSION) -le 10 -a \ - $(DARWIN_MINOR_VERSION) -le 5 ] ; then echo $(1); else echo $(2); fi ;) +os_x_before = $(shell if [ $(DARWIN_MAJOR_VERSION) -le $(1) -a \ + $(DARWIN_MINOR_VERSION) -le $(2) ] ; then echo $(3); else echo $(4); fi ;) # Snow Leopards build environment has no longer restrictions as described above -HOSTCC= $(call before-snow-leopard, cc, gcc) -HOSTCFLAGS += $(call before-snow-leopard, -traditional-cpp) -HOSTLDFLAGS += $(call before-snow-leopard, -multiply_defined suppress) +HOSTCC= $(call os_x_before, 10, 5, cc, gcc) +HOSTCFLAGS += $(call os_x_before, 10, 4, -traditional-cpp) +HOSTLDFLAGS += $(call os_x_before, 10, 5, -multiply_defined suppress) I figured out that I can even switch to gcc on that box: ---8--- $ gcc --version powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ---8--- Therefore your patch could be simplified by switching from 'before-snow-leopard' to 'before-leopard' logic. Nevertheless i like the os_x_before macro more than the first solution. regards Andreas Bießmann ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Fix condition where bootm_size not set and wrong memory size reported
On Jul 8, 2010, at 5:19 PM, Kumar Gala wrote: On Jul 8, 2010, at 10:11 AM, Matthew McClintock wrote: If the user sets bootm_low and does not set bootm_size, u-boot will report the memory node in the flat device tree incorrectly. Instead of reporting the remaining size of memory, it will report the total available memory which is incorrect. Specifically this fixes the situation when booting a relocatable kernel and the memory is reported as an offset and size in the device tree, and the size needs to be adjusted accordingly. Signed-off-by: Matthew McClintock m...@freescale.com --- common/image.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) Acked-by: Kumar Gala ga...@kernel.crashing.org poke on applying this patch. - k ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Getting started with uboot
Where does uboot store the environment variables? I have my tx25 board booting correctly from uboot when entering interactive commands: U-Boot 2010.06 (Aug 02 2010 - 19:53:42) CPU: Freescale i.MX25 at 399 MHz DRAM: 32 MiB NAND: 128 MiB *** Warning - bad CRC or NAND, using default environment In:serial Out: serial Err: serial Net: FEC_MXC Hit any key to stop autoboot: 0 = setenv bootcmd = nand read 0x80108000 0x0204 0x0026 NAND read: device 0 offset 0x204, size 0x26 2490368 bytes read: OK = NAND read: device 0 offset 0x204, size 0x26 2490368 bytes read: OK = bootm 0x80108000 ## Booting kernel from Legacy Image at 80108000 ... Image Name: Linux-2.6.31 Image Type: ARM Linux Kernel Image (uncompressed) Data Size:1517328 Bytes = 1.4 MiB Load Address: 80008000 Entry Point: 80008000 Verifying Checksum ... OK Loading Kernel Image ... OK OK Starting kernel ... Uncompressing Linux done, booting the kernel. But when I call 'saveenv' then it doesn't boot any longer; it seems that 'saveenv' overwrites parts of the root file system. So, my question is: where does uboot save the environment? -- Thanks, Thomas ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Getting started with uboot
Dear Thomas Heller, In message i3ccjf$a0...@dough.gmane.org you wrote: Where does uboot store the environment variables? I have my tx25 board booting correctly from uboot when entering interactive commands: Check the board config file: include/configs/tx25.h: 33 34 #define CONFIG_SYS_MONITOR_LEN (256 10) /* 256 kB for U-Boot */ 35 ... 102 #define CONFIG_ENV_IS_IN_NAND 103 #define CONFIG_ENV_OFFSET CONFIG_SYS_MONITOR_LEN 104 #define CONFIG_ENV_SIZE (128 * 1024)/* 128 kB NAND block size */ 105 #define CONFIG_ENV_OFFSET_REDUND(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) = nand read 0x80108000 0x0204 0x0026 NAND read: device 0 offset 0x204, size 0x26 2490368 bytes read: OK 0x0204 is more than 32 MiB, i. e. far, far away from the envrionment. But when I call 'saveenv' then it doesn't boot any longer; it seems that 'saveenv' overwrites parts of the root file system. So, my question is: where does uboot save the environment? This does not happen on my system. saveenv leaves the whole NAND starting at offset 0x8 and above untouched. Is this an original TX25 board? Did you make any modifications to U-Boot? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Hi there! This is just a note from me, to you, to tell you, the per- son reading this note, that I can't think up any more famous quotes, jokes, nor bizarre stories, so you may as well go home. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V5 4/4] edminiv2: add mvsata_ide and cmd_ide support
Le 04/08/2010 09:23, Albert ARIBAUD a écrit : Le 04/08/2010 08:08, Prafulla Wadaskar a écrit : 3. Instead of adding fixed 41/50 usec delay between the writes to Scontrol It would be good if you can check/poll some status bit associated with IDE controller, this will make mvsata driver rock solid on any platform. I've looked up the marvell kirkwood and orion docs for such a control bit but found none. I'll look it up again, however it might help if you can find someone inside Marvell who would, and could, provide the info. I think I've found out how it works. I initially thought the DET field in SControl was a sort of reset line, and that writing a 1 would put the controller in continuous reset and writing a 0 to put it out of reset. But actually, DET is a command field : a write of 1 starts the reset sequence immediately: the DET field of the SStatus register will go from 0 to 3 (possibly passing through 1). Then you can set SControl's DET back to 0 so that you can use the port. Thus the init sequence becomes: write 3 to SControl's IPM and 1 to DET, read SStatus until its DET field is 3, write 0 to SControl's DET. However I'll keep a timeout value in the status read loop, because you can't expect SStatus to become 3: it could stay 0 if no drive is connected, for instance. If I did not keep a timeout, u-boot would freeze. :/ Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Getting started with uboot
Wolfgang Denk schrieb: Dear Thomas Heller, In message i3ccjf$a0...@dough.gmane.org you wrote: Where does uboot store the environment variables? I have my tx25 board booting correctly from uboot when entering interactive commands: Check the board config file: include/configs/tx25.h: 33 34 #define CONFIG_SYS_MONITOR_LEN (256 10) /* 256 kB for U-Boot */ 35 ... 102 #define CONFIG_ENV_IS_IN_NAND 103 #define CONFIG_ENV_OFFSET CONFIG_SYS_MONITOR_LEN 104 #define CONFIG_ENV_SIZE (128 * 1024)/* 128 kB NAND block size */ 105 #define CONFIG_ENV_OFFSET_REDUND(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) = nand read 0x80108000 0x0204 0x0026 NAND read: device 0 offset 0x204, size 0x26 2490368 bytes read: OK 0x0204 is more than 32 MiB, i. e. far, far away from the envrionment. Yes, but this is the kernel partition. The rootfs starts at a lower address. And actually this is the problem: I put uboot into the RedBoot flash partition, which is only 0x4 in size (256 kB), but uboot apparently needs much more. Which raises the question: why is the environment so large? Wouldn't a few kB be enough (4kB, 16kB for example)? Thanks, also to Elie, for the quick answers. I'll get it to work now. Thomas ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V5 4/4] edminiv2: add mvsata_ide and cmd_ide support
Some thoughts, and then a question for Wolfgang regarding IDE config macros Le 04/08/2010 08:08, Prafulla Wadaskar a écrit : I have two more suggestion, 1. put ide_preinit function in mvsata driver, define CONFIG_IDE_PREINIT in board config file This could help reducing the source code size, because then we don't need an mvsata_ide.h any more as mvsata_ide_initialize_port() would become a static function ov mvsata_ide.c, called by ide_preinit(). One issue is that ide_preinit() should initialize only those ports that exist and are used in a given board. If we put it in mvsata_ide.c, then we need to rely on config macros to tell ide_preinit() where port 0 is, and if port 1 exists/is used, where it is too. Note that this info is exactly the same as that given in configs for cmd_ide. For instance, for ED Mini V2 (uses port 1 only) we'd have something like /* ATA registers base is at SATA controller base */ #define CONFIG_SYS_ATA_BASE_ADDRORION5X_SATA_BASE /* ATA bus 0 is orion5x port 1 on ED Mini V2 */ #define CONFIG_SYS_ATA_IDE0_OFFSET ORION5X_SATA_PORT1_OFFSET ... and for OpenRD, which has two SATA ports: /* ATA registers base is at SATA controller base */ #define CONFIG_SYS_ATA_BASE_ADDRKW_SATA_BASE /* ATA bus 0 is orion5x port 1 on ED Mini V2 */ #define CONFIG_SYS_ATA_IDE0_OFFSET KW_SATA_PORT0_OFFSET #define CONFIG_SYS_ATA_IDE1_OFFSET KW_SATA_PORT1_OFFSET Theoretically I should create a similar set of macros for mvsata_ide, but it seems to be that since mvsata_ide is intended to always be used along with cmd_ide, it would be simpler to use the cmd_ide macros CONFIG_SYS_ATA_x macros in mvsata_ide.c to determine port0's address and, if port1 exists, port1's address. Wolfgang, would it be allowable for mvsata_ide to use macros intended for cmd_ide? Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Getting started with uboot
Dear Thomas Heller, In message i3chbe$ta...@dough.gmane.org you wrote: And actually this is the problem: I put uboot into the RedBoot flash partition, which is only 0x4 in size (256 kB), but uboot apparently needs much more. Right - it needs two more flash blocks. Which raises the question: why is the environment so large? Wouldn't a few kB be enough (4kB, 16kB for example)? NAND flash cannot be erased in arbitray sizes, but only in blocks; on the TX25 the erase block size is 128 kB. So with redundant environment we need two block for the U-Boot code, and two more for the 2 copies of the environment = a total of 512 KiB. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital computer or the gears of a cycle transmission as he does at the top of a mountain or in the petals of a flower. - R. Pirsig, Zen and the Art of Motorcycle Maintenance ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2] Adds driver for Xilinx' xps_spi SPI controller.
This code differs in only trivial ways from the altera_spi driver. It plays nice with Thomas Chou's mmc_spi driver, as well as with SPI flash. Documentation for the SPI core is available here: http://www.xilinx.com/support/documentation/ip_documentation/xps_spi.pdf Signed-off-by: Graeme Smecher graeme.smec...@mail.mcgill.ca --- drivers/spi/Makefile |1 + drivers/spi/xilinx_spi.c | 173 ++ 2 files changed, 174 insertions(+), 0 deletions(-) create mode 100644 drivers/spi/xilinx_spi.c diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index dfcbb8b..eeba5ef 100644 --- a/drivers/spi/Makefile +++ b/drivers/spi/Makefile @@ -36,6 +36,7 @@ COBJS-$(CONFIG_MPC52XX_SPI) += mpc52xx_spi.o COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o +COBJS-$(CONFIG_XILINX_SPI) += xilinx_spi.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c new file mode 100644 index 000..281c369 --- /dev/null +++ b/drivers/spi/xilinx_spi.c @@ -0,0 +1,173 @@ +/* + * Xilinx SPI driver + * + * based on bfin_spi.c, by way of altera_spi.c + * Copyright (c) 2005-2008 Analog Devices Inc. + * Copyright (c) 2010 Thomas Chou tho...@wytron.com.tw + * Copyright (c) 2010 Graeme Smecher graeme.smec...@mail.mcgill.ca + * + * Licensed under the GPL-2 or later. + */ +#include common.h +#include asm/io.h +#include malloc.h +#include spi.h + +#define XILINX_SPI_RR 0x6c +#define XILINX_SPI_TR 0x68 +#define XILINX_SPI_SR 0x64 +#define XILINX_SPI_CR 0x60 +#define XILINX_SPI_SSR 0x70 + +#define XILINX_SPI_SR_RX_EMPTY_MSK 0x01 + +#define XILINX_SPI_CR_DEFAULT (0x0006) +#define XILINX_SPI_CR_MSS_MSK (0x0080) + +#if XPAR_XSPI_NUM_INSTANCES 4 +# warning The xilinx_spi driver will ignore some of your SPI peripherals! +#endif + +static const ulong xilinx_spi_base_list[] = { +#ifdef XPAR_SPI_0_BASEADDR + XPAR_SPI_0_BASEADDR, +#endif +#ifdef XPAR_SPI_1_BASEADDR + XPAR_SPI_1_BASEADDR, +#endif +#ifdef XPAR_SPI_2_BASEADDR + XPAR_SPI_2_BASEADDR, +#endif +#ifdef XPAR_SPI_3_BASEADDR + XPAR_SPI_3_BASEADDR, +#endif +}; + +struct xilinx_spi_slave { + struct spi_slave slave; + ulong base; +}; +#define to_xilinx_spi_slave(s) container_of(s, struct xilinx_spi_slave, slave) + +__attribute__((weak)) +int spi_cs_is_valid(unsigned int bus, unsigned int cs) +{ + return bus ARRAY_SIZE(xilinx_spi_base_list) cs 32; +} + +__attribute__((weak)) +void spi_cs_activate(struct spi_slave *slave) +{ + struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave); + writel(~(1 slave-cs), xilspi-base + XILINX_SPI_SSR); + writel(XILINX_SPI_CR_DEFAULT | XILINX_SPI_CR_MSS_MSK, + xilspi-base + XILINX_SPI_CR); +} + +__attribute__((weak)) +void spi_cs_deactivate(struct spi_slave *slave) +{ + struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave); + + writel(XILINX_SPI_CR_DEFAULT, xilspi-base + XILINX_SPI_CR); + writel(~0, xilspi-base + XILINX_SPI_SSR); +} + +void spi_init(void) +{ +} + +struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, + unsigned int max_hz, unsigned int mode) +{ + struct xilinx_spi_slave *xilspi; + + if (!spi_cs_is_valid(bus, cs)) + return NULL; + + xilspi = malloc(sizeof(*xilspi)); + if (!xilspi) + return NULL; + + xilspi-slave.bus = bus; + xilspi-slave.cs = cs; + xilspi-base = xilinx_spi_base_list[bus]; + debug(%s: bus:%i cs:%i base:%lx\n, __func__, + bus, cs, xilspi-base); + + return xilspi-slave; +} + +void spi_free_slave(struct spi_slave *slave) +{ + struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave); + free(xilspi); +} + +int spi_claim_bus(struct spi_slave *slave) +{ + struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave); + + debug(%s: bus:%i cs:%i\n, __func__, slave-bus, slave-cs); + writel(XILINX_SPI_CR_DEFAULT, xilspi-base + XILINX_SPI_CR); + writel(~0, xilspi-base + XILINX_SPI_SSR); + return 0; +} + +void spi_release_bus(struct spi_slave *slave) +{ + struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave); + + debug(%s: bus:%i cs:%i\n, __func__, slave-bus, slave-cs); + writel(~0, xilspi-base + XILINX_SPI_SSR); +} + +#ifndef CONFIG_XILINX_SPI_IDLE_VAL +# define CONFIG_XILINX_SPI_IDLE_VAL 0xff +#endif + +int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, +void *din, unsigned long flags) +{ + struct xilinx_spi_slave *xilspi = to_xilinx_spi_slave(slave); + /* assume spi core configured to do 8 bit transfers */ + uint bytes = bitlen / 8; + const uchar *txp = dout; + uchar *rxp = din;
Re: [U-Boot] [PATCH] Adds driver for Xilinx' xps_spi SPI controller.
Hi Mike, Thanks again for reviewing! Comments in-line; an updated patch will follow. On 03/08/10 10:59 AM, Mike Frysinger wrote: On Tuesday, August 03, 2010 11:47:42 Graeme Smecher wrote: --- a/drivers/spi/Makefile +++ b/drivers/spi/Makefile COBJS-$(CONFIG_ALTERA_SPI) += altera_spi.o +COBJS-$(CONFIG_XILINX_SPI) += xilinx_spi.o COBJS-$(CONFIG_ATMEL_DATAFLASH_SPI) += atmel_dataflash_spi.o this is a sorted list. please keep it that way Whoops -- OK. --- /dev/null +++ b/drivers/spi/xilinx_spi.c +static ulong xilinx_spi_base_list[] = { +#ifdef XPAR_SPI_0_BASEADDR +XPAR_SPI_0_BASEADDR, +#endif +#ifdef XPAR_SPI_1_BASEADDR +XPAR_SPI_1_BASEADDR, +#endif +#ifdef XPAR_SPI_2_BASEADDR +XPAR_SPI_2_BASEADDR, +#endif +#ifdef XPAR_SPI_3_BASEADDR +XPAR_SPI_3_BASEADDR, +#endif +}; if this is only ever read, you might want to declare it const so it ends up in the rodata section. Done. what if someone defines just XPAR_SPI_3_BASEADDR ? do you want to be consistent in bus id 3 always corresponds to XPAR_SPI_3_BASEADDR ? or are you OK with the numbers always being relative ? doesnt matter to me, just highlighting some things that might have been missed. These numbers come from autogenerated headers and are (as far as I know) always numbered from 0. Offhand, the above code seems like the least confusing approach. I don't have a particularly strong opinion either. cheers, Graeme ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] S5P: mmc: use the standard debug macro
Use the standard debug macro instead of the costom macro Signed-off-by: Minkyu Kang mk7.k...@samsung.com Cc: Wolfgang Denk w...@denx.de --- drivers/mmc/s5p_mmc.c | 30 -- 1 files changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/mmc/s5p_mmc.c b/drivers/mmc/s5p_mmc.c index 669b1d0..872f0bb 100644 --- a/drivers/mmc/s5p_mmc.c +++ b/drivers/mmc/s5p_mmc.c @@ -23,12 +23,6 @@ #include asm/io.h #include asm/arch/mmc.h -#ifdef DEBUG_S5P_HSMMC -#define dbg(x...) printf(x) -#else -#define dbg(x...) do { } while (0) -#endif - /* support 4 mmc hosts */ struct mmc mmc_dev[4]; struct mmc_host mmc_host[4]; @@ -47,7 +41,7 @@ static void mmc_prepare_data(struct mmc_host *host, struct mmc_data *data) { unsigned char ctrl; - dbg(data-dest: %08x\n, (u32)data-dest); + debug(data-dest: %08x\n, (u32)data-dest); writel((u32)data-dest, host-reg-sysad); /* * DMASEL[4:3] @@ -128,7 +122,7 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, if (data) mmc_prepare_data(host, data); - dbg(cmd-arg: %08x\n, cmd-cmdarg); + debug(cmd-arg: %08x\n, cmd-cmdarg); writel(cmd-cmdarg, host-reg-argument); if (data) @@ -165,7 +159,7 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, if (data) flags |= (1 5); - dbg(cmd: %d\n, cmd-cmdidx); + debug(cmd: %d\n, cmd-cmdidx); writew((cmd-cmdidx 8) | flags, host-reg-cmdreg); @@ -186,11 +180,11 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, if (mask (1 16)) { /* Timeout Error */ - dbg(timeout: %08x cmd %d\n, mask, cmd-cmdidx); + debug(timeout: %08x cmd %d\n, mask, cmd-cmdidx); return TIMEOUT; } else if (mask (1 15)) { /* Error Interrupt */ - dbg(error: %08x cmd %d\n, mask, cmd-cmdidx); + debug(error: %08x cmd %d\n, mask, cmd-cmdidx); return -1; } @@ -206,7 +200,7 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, cmd-response[i] |= readb(offset - 1); } - dbg(cmd-resp[%d]: %08x\n, + debug(cmd-resp[%d]: %08x\n, i, cmd-response[i]); } } else if (cmd-resp_type MMC_RSP_BUSY) { @@ -223,10 +217,10 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, } cmd-response[0] = readl(host-reg-rspreg0); - dbg(cmd-resp[0]: %08x\n, cmd-response[0]); + debug(cmd-resp[0]: %08x\n, cmd-response[0]); } else { cmd-response[0] = readl(host-reg-rspreg0); - dbg(cmd-resp[0]: %08x\n, cmd-response[0]); + debug(cmd-resp[0]: %08x\n, cmd-response[0]); } } @@ -242,11 +236,11 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, return -1; } else if (mask (1 3)) { /* DMA Interrupt */ - dbg(DMA end\n); + debug(DMA end\n); break; } else if (mask (1 1)) { /* Transfer Complete */ - dbg(r/w is done\n); + debug(r/w is done\n); break; } } @@ -288,7 +282,7 @@ static void mmc_change_clock(struct mmc_host *host, uint clock) div = 2; else div = 1; - dbg(div: %d\n, div); + debug(div: %d\n, div); div = 1; /* @@ -325,7 +319,7 @@ static void mmc_set_ios(struct mmc *mmc) unsigned char ctrl; unsigned long val; - dbg(set_ios: bus_width: %x, clock: %d\n, mmc-bus_width, mmc-clock); + debug(bus_width: %x, clock: %d\n, mmc-bus_width, mmc-clock); /* * SELCLKPADDS[17:16] -- 1.7.0.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] update the MIPS u-boot.lds
From: Xiangfu Liu xian...@openmobilefree.net pb1x00 is only used in Little-endian, so its default endian should be set to LE as well Signed-off-by: Xiangfu Liu xian...@openmobilefree.net Acked-by: Shinya Kuribayashi skuri...@pobox.com --- board/dbau1x00/u-boot.lds|2 +- board/gth2/u-boot.lds|2 +- board/incaip/u-boot.lds |2 +- board/pb1x00/u-boot.lds |2 +- board/purple/u-boot.lds |2 +- board/qemu-mips/u-boot.lds |2 +- examples/standalone/mips.lds |2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/board/dbau1x00/u-boot.lds b/board/dbau1x00/u-boot.lds index 9a6cd1b..3c4fbe3 100644 --- a/board/dbau1x00/u-boot.lds +++ b/board/dbau1x00/u-boot.lds @@ -24,7 +24,7 @@ /* OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-bigmips) */ -OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradbigmips) +OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradlittlemips) OUTPUT_ARCH(mips) ENTRY(_start) SECTIONS diff --git a/board/gth2/u-boot.lds b/board/gth2/u-boot.lds index e6eee9b..aeb0fcc 100644 --- a/board/gth2/u-boot.lds +++ b/board/gth2/u-boot.lds @@ -24,7 +24,7 @@ /* OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-bigmips) */ -OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradbigmips) +OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradlittlemips) OUTPUT_ARCH(mips) ENTRY(_start) SECTIONS diff --git a/board/incaip/u-boot.lds b/board/incaip/u-boot.lds index 9a6cd1b..3c4fbe3 100644 --- a/board/incaip/u-boot.lds +++ b/board/incaip/u-boot.lds @@ -24,7 +24,7 @@ /* OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-bigmips) */ -OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradbigmips) +OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradlittlemips) OUTPUT_ARCH(mips) ENTRY(_start) SECTIONS diff --git a/board/pb1x00/u-boot.lds b/board/pb1x00/u-boot.lds index 9a6cd1b..358cc54 100644 --- a/board/pb1x00/u-boot.lds +++ b/board/pb1x00/u-boot.lds @@ -24,7 +24,7 @@ /* OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-bigmips) */ -OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradbigmips) +OUTPUT_FORMAT(elf32-tradlittlemips, elf32-tradbigmips, elf32-tradlittlemips) OUTPUT_ARCH(mips) ENTRY(_start) SECTIONS diff --git a/board/purple/u-boot.lds b/board/purple/u-boot.lds index 1881e65..542601a 100644 --- a/board/purple/u-boot.lds +++ b/board/purple/u-boot.lds @@ -24,7 +24,7 @@ /* OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-bigmips) */ -OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradbigmips) +OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradlittlemips) OUTPUT_ARCH(mips) ENTRY(_start) SECTIONS diff --git a/board/qemu-mips/u-boot.lds b/board/qemu-mips/u-boot.lds index ad058ca..bd16786 100644 --- a/board/qemu-mips/u-boot.lds +++ b/board/qemu-mips/u-boot.lds @@ -24,7 +24,7 @@ /* OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-bigmips) */ -OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradbigmips) +OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradlittlemips) OUTPUT_ARCH(mips) ENTRY(_start) SECTIONS diff --git a/examples/standalone/mips.lds b/examples/standalone/mips.lds index 717b201..63a1c92 100644 --- a/examples/standalone/mips.lds +++ b/examples/standalone/mips.lds @@ -24,7 +24,7 @@ /* OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-bigmips) */ -OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradbigmips) +OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradlittlemips) OUTPUT_ARCH(mips) SECTIONS { -- 1.7.0.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3] update the MIPS u-boot.lds
From the document, if set all arguments in OUTPUT_FORMAT to tradbigmips, then even add -EL to gcc we still get EB format. pb1x00 is only used in Little-endian, so its default endian should be set to LE as well Signed-off-by: Xiangfu Liu xian...@openmobilefree.net Acked-by: Shinya Kuribayashi skuri...@pobox.com --- Hi Wolfgang sorry, please ignore the my last email about this patch. Hi Shinya thanks for your patient on teach me patch stuff. I will never stop learning :). v1: From the document, if set all arguments in OUTPUT_FORMAT to tradbigmips, then even add -EL to gcc we still get EB format. v2: pb1x00 is only used in Little-endian, so its default endian should be set to LE as well v3: only fix the patch format issue. board/dbau1x00/u-boot.lds|2 +- board/gth2/u-boot.lds|2 +- board/incaip/u-boot.lds |2 +- board/pb1x00/u-boot.lds |2 +- board/purple/u-boot.lds |2 +- board/qemu-mips/u-boot.lds |2 +- examples/standalone/mips.lds |2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/board/dbau1x00/u-boot.lds b/board/dbau1x00/u-boot.lds index 9a6cd1b..3c4fbe3 100644 --- a/board/dbau1x00/u-boot.lds +++ b/board/dbau1x00/u-boot.lds @@ -24,7 +24,7 @@ /* OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-bigmips) */ -OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradbigmips) +OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradlittlemips) OUTPUT_ARCH(mips) ENTRY(_start) SECTIONS diff --git a/board/gth2/u-boot.lds b/board/gth2/u-boot.lds index e6eee9b..aeb0fcc 100644 --- a/board/gth2/u-boot.lds +++ b/board/gth2/u-boot.lds @@ -24,7 +24,7 @@ /* OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-bigmips) */ -OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradbigmips) +OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradlittlemips) OUTPUT_ARCH(mips) ENTRY(_start) SECTIONS diff --git a/board/incaip/u-boot.lds b/board/incaip/u-boot.lds index 9a6cd1b..3c4fbe3 100644 --- a/board/incaip/u-boot.lds +++ b/board/incaip/u-boot.lds @@ -24,7 +24,7 @@ /* OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-bigmips) */ -OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradbigmips) +OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradlittlemips) OUTPUT_ARCH(mips) ENTRY(_start) SECTIONS diff --git a/board/pb1x00/u-boot.lds b/board/pb1x00/u-boot.lds index 9a6cd1b..358cc54 100644 --- a/board/pb1x00/u-boot.lds +++ b/board/pb1x00/u-boot.lds @@ -24,7 +24,7 @@ /* OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-bigmips) */ -OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradbigmips) +OUTPUT_FORMAT(elf32-tradlittlemips, elf32-tradbigmips, elf32-tradlittlemips) OUTPUT_ARCH(mips) ENTRY(_start) SECTIONS diff --git a/board/purple/u-boot.lds b/board/purple/u-boot.lds index 1881e65..542601a 100644 --- a/board/purple/u-boot.lds +++ b/board/purple/u-boot.lds @@ -24,7 +24,7 @@ /* OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-bigmips) */ -OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradbigmips) +OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradlittlemips) OUTPUT_ARCH(mips) ENTRY(_start) SECTIONS diff --git a/board/qemu-mips/u-boot.lds b/board/qemu-mips/u-boot.lds index ad058ca..bd16786 100644 --- a/board/qemu-mips/u-boot.lds +++ b/board/qemu-mips/u-boot.lds @@ -24,7 +24,7 @@ /* OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-bigmips) */ -OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradbigmips) +OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradlittlemips) OUTPUT_ARCH(mips) ENTRY(_start) SECTIONS diff --git a/examples/standalone/mips.lds b/examples/standalone/mips.lds index 717b201..63a1c92 100644 --- a/examples/standalone/mips.lds +++ b/examples/standalone/mips.lds @@ -24,7 +24,7 @@ /* OUTPUT_FORMAT(elf32-bigmips, elf32-bigmips, elf32-bigmips) */ -OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradbigmips) +OUTPUT_FORMAT(elf32-tradbigmips, elf32-tradbigmips, elf32-tradlittlemips) OUTPUT_ARCH(mips) SECTIONS { -- 1.7.0.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/8] nds32: add support of general functions in arch lib
Add Makefile, board.c, interrupts.c and bootm.c functions to nds32 architecture. Signed-off-by: Macpaul Lin macp...@andestech.com --- arch/nds32/lib/Makefile | 52 + arch/nds32/lib/board.c | 452 +++ arch/nds32/lib/bootm.c | 240 +++ arch/nds32/lib/interrupts.c | 126 4 files changed, 870 insertions(+), 0 deletions(-) create mode 100644 arch/nds32/lib/Makefile create mode 100644 arch/nds32/lib/board.c create mode 100644 arch/nds32/lib/bootm.c create mode 100644 arch/nds32/lib/interrupts.c diff --git a/arch/nds32/lib/Makefile b/arch/nds32/lib/Makefile new file mode 100644 index 000..22748ce --- /dev/null +++ b/arch/nds32/lib/Makefile @@ -0,0 +1,52 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# Copyright (C) 2010 Andes Technology Corporation +# Shawn Lin, Andes Technology Corporation nobuh...@andestech.com +# Macpaul Lin, Andes Technology Corporation macp...@andestech.com +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(ARCH).a + +OBJS := board.o bootm.o interrupts.o + +all: $(LIB) + +$(LIB):$(OBJS) $(SOBJS) + $(AR) crv $@ $^ + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c new file mode 100644 index 000..b4395eb --- /dev/null +++ b/arch/nds32/lib/board.c @@ -0,0 +1,452 @@ +/* + * (C) Copyright 2002-2006 + * Wolfgang Denk, DENX Software Engineering, w...@denx.de. + * + * Copyright (C) 2010 Andes Technology Corporation + * Shawn Lin, Andes Technology Corporation nobuh...@andestech.com + * Macpaul Lin, Andes Technology Corporation macp...@andestech.com + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +/* + * To match the U-Boot user interface on ARM platforms to the U-Boot + * standard (as on PPC platforms), some messages with debug character + * are removed from the default U-Boot build. + * + * Define DEBUG here if you want additional info as shown below + * printed upon startup: + * + * U-Boot code: 00F0 - 00F3C774 BSS: - 00FC3274 + * IRQ Stack: 00ebff7c + * FIQ Stack: 00ebef7c + */ + +#include common.h +#include command.h +#include malloc.h +#include stdio_dev.h +#include timestamp.h +#include version.h +#include net.h +#include serial.h +#include nand.h +#include onenand_uboot.h +#include mmc.h + +#ifdef CONFIG_BITBANGMII +#include miiphy.h +#endif + +#ifdef CONFIG_DRIVER_SMC9 +#include ../drivers/net/smc9.h +#endif +#ifdef CONFIG_DRIVER_LAN91C96 +#include ../drivers/net/lan91c96.h +#endif + +DECLARE_GLOBAL_DATA_PTR; + +ulong monitor_flash_len; + +#ifdef CONFIG_HAS_DATAFLASH +extern int AT91F_DataflashInit(void); +extern void dataflash_print_info(void); +#endif + +#ifndef CONFIG_IDENT_STRING +#define CONFIG_IDENT_STRING +#endif + +const char version_string[] = + U_BOOT_VERSION ( U_BOOT_DATE - U_BOOT_TIME )CONFIG_IDENT_STRING; + +#ifdef CONFIG_DRIVER_RTL8019 +extern void rtl8019_get_enetaddr (uchar * addr); +#endif + +#if defined(CONFIG_HARD_I2C) || \ +defined(CONFIG_SOFT_I2C) +#include i2c.h +#endif +
[U-Boot] [PATCH v2 3/8] nds32: add header files support for nds32
Add generic header files support for nds32 architecture. Signed-off-by: Macpaul Lin macp...@andestech.com --- arch/nds32/include/asm/andesboot.h| 242 +++ arch/nds32/include/asm/bitops.h | 150 ++ arch/nds32/include/asm/byteorder.h| 36 arch/nds32/include/asm/config.h | 26 +++ arch/nds32/include/asm/global_data.h | 76 +++ arch/nds32/include/asm/io.h | 348 + arch/nds32/include/asm/mach-types.h | 29 +++ arch/nds32/include/asm/memory.h | 19 ++ arch/nds32/include/asm/posix_types.h | 84 arch/nds32/include/asm/processor.h| 25 +++ arch/nds32/include/asm/ptrace.h | 22 ++ arch/nds32/include/asm/ptregs.h | 82 arch/nds32/include/asm/setup.h| 272 + arch/nds32/include/asm/string.h | 57 ++ arch/nds32/include/asm/types.h| 67 +++ arch/nds32/include/asm/u-boot-nds32.h | 76 +++ arch/nds32/include/asm/u-boot.h | 69 +++ arch/nds32/include/asm/unaligned.h| 31 +++ 18 files changed, 1712 insertions(+), 0 deletions(-) create mode 100644 arch/nds32/include/asm/andesboot.h create mode 100644 arch/nds32/include/asm/bitops.h create mode 100644 arch/nds32/include/asm/byteorder.h create mode 100644 arch/nds32/include/asm/config.h create mode 100644 arch/nds32/include/asm/global_data.h create mode 100644 arch/nds32/include/asm/io.h create mode 100644 arch/nds32/include/asm/mach-types.h create mode 100644 arch/nds32/include/asm/memory.h create mode 100644 arch/nds32/include/asm/posix_types.h create mode 100644 arch/nds32/include/asm/processor.h create mode 100644 arch/nds32/include/asm/ptrace.h create mode 100644 arch/nds32/include/asm/ptregs.h create mode 100644 arch/nds32/include/asm/setup.h create mode 100644 arch/nds32/include/asm/string.h create mode 100644 arch/nds32/include/asm/types.h create mode 100644 arch/nds32/include/asm/u-boot-nds32.h create mode 100644 arch/nds32/include/asm/u-boot.h create mode 100644 arch/nds32/include/asm/unaligned.h diff --git a/arch/nds32/include/asm/andesboot.h b/arch/nds32/include/asm/andesboot.h new file mode 100644 index 000..8d7a402 --- /dev/null +++ b/arch/nds32/include/asm/andesboot.h @@ -0,0 +1,242 @@ +/* + * (C) Copyright 2002 + * Sysgo Real-Time Solutions, GmbH www.elinos.com + * Marius Groeger mgroe...@sysgo.de + * + * (C) Copyright 2002 + * Sysgo Real-Time Solutions, GmbH www.elinos.com + * Alex Zuepke a...@sysgo.de + * + * Copyright (C) 2010 Andes Technology Corporation + * Shawn Lin, Andes Technology Corporation nobuh...@andestech.com + * Macpaul Lin, Andes Technology Corporation macp...@andestech.com + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef _ANDESBOOT_H_ +#define _ANDESBOOT_H_ 1 + +#undef _LINUX_CONFIG_H +#define _LINUX_CONFIG_H 1 /* avoid reading Linux autoconf.h file */ +#include config.h +#include asm/types.h +#include asm/u-boot.h +#include stdarg.h +#include common.h +#include flash.h +#include image.h + +#ifdef DEBUG +#define debug(fmt,args...) printf (fmt ,##args) +#else +#define debug(fmt,args...) +#endif + +/* + * The environment storages is simply a list of '\0'-terminated + * name=value strings, the end of the list marked by a double '\0'. + * New entries are always added at the end. Deleting an entry shifts + * the remaining entries to the front. Replacing an entry is a + * combination of deleting the old and adding the new value. + * + * The environment is preceeded by a 32 bit CRC over the data part. + */ +#define bi_env_data bi_env-data +#define bi_env_crc bi_env-crc + +/* common/crc32.c */ +/* uint32_t crc32 (uint32_t, const unsigned char *, uint); */ +/* uint32_t crc32_no_comp(uint32_t crc, const Bytef *buf, uInt len); */ + +/* + * Don't define some stuff private to andesboot target code + */ +#ifndef HOST_TOOLS + +/* board/.../env.c */ +intboard_env_getchar(bd_t * bd, int index, uchar *c); +intboard_env_save (bd_t * bd, env_t *data, int size); +intboard_env_copy (bd_t * bd, env_t *data, int size); +uchar *board_env_getaddr(bd_t * bd, int index); + +/* + * Function Prototypes
[U-Boot] [PATCH v2 5/8] nds32: add standalone related support for nds32
Add standalone program related support for nds32 architecture. Signed-off-by: Macpaul Lin macp...@andestech.com --- examples/standalone/nds32.lds | 64 + examples/standalone/stubs.c | 17 +- examples/standalone/x86-testapp.c | 12 +++ 3 files changed, 92 insertions(+), 1 deletions(-) create mode 100644 examples/standalone/nds32.lds diff --git a/examples/standalone/nds32.lds b/examples/standalone/nds32.lds new file mode 100644 index 000..1a90873 --- /dev/null +++ b/examples/standalone/nds32.lds @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2010 Andes Technology Corporation + * Shawn Lin, Andes Tech Crop. nobuh...@andestech.com + * Macpaul Lin, Andes Technology Corporation macp...@andestech.com + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +OUTPUT_FORMAT(elf32-nds32, elf32-nds32, elf32-nds32) +OUTPUT_ARCH(nds32) +ENTRY(_start) +SECTIONS +{ + . = 0x; + + . = ALIGN(4); + .text : + { + *(.text) + } + + . = ALIGN(4); + .data : { *(.data) } + + . = ALIGN(4); + .data : { *(.data) } + + . = ALIGN(4); + + .got : { + __got_start = .; + *(.got) + __got_end = .; + } + + . = ALIGN(4); + __bss_start = .; + .bss : { *(.bss) } + __bss_end = .; + + . = ALIGN(4); + .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } + + _end = .; + + . = 0x0200; + .u_boot_ohci_data_st : { *(.u_boot_ohci_data_st) } +} diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c index 2d2e709..a763d0d 100644 --- a/examples/standalone/stubs.c +++ b/examples/standalone/stubs.c @@ -167,8 +167,23 @@ gd_t *global_data; jmp %%g1\n \ nop\n \ : : i(offsetof(gd_t, jt)), i(XF_ ## x * sizeof(void *)) : g1 ); - +#elif defined(CONFIG_NDS32) +/* + * r16 holds the pointer to the global_data. gp is call clobbered. + * not support reduced register (16 GPR). + */ +#define EXPORT_FUNC(x) \ + asm volatile ( \ + .globl #x \n\ +#x :\n \ + lwi $r16, [$gp + (%0)]\n \ + lwi $r16, [$r16 + (%1)]\n \ + jr $r16\n \ + : : i(offsetof(gd_t, jt)), i(XF_ ## x * sizeof(void *)) : $r16 ); #else +/*addi$sp, $sp, -24\n\ + br $r16\n \*/ + #error stubs definition missing for this architecture #endif diff --git a/examples/standalone/x86-testapp.c b/examples/standalone/x86-testapp.c index e8603d9..9f80a5d 100644 --- a/examples/standalone/x86-testapp.c +++ b/examples/standalone/x86-testapp.c @@ -52,6 +52,16 @@ asm volatile ( \ lw $25, %1($25)\n \ jr $25\n \ : : i(offsetof(xxx_t, pfunc)), i(XF_ ## x * sizeof(void *)) : t9); +#elif defined(__nds32__) +#define EXPORT_FUNC(x) \ +asm volatile ( \ + .globl mon_ #x \n\ +mon_ #x :\n\ + lwi $r16, [$gp + (%0)]\n \ + lwi $r16, [$r16 + (%1)]\n \ + jr $r16\n \ + : : i(offsetof(xxx_t, pfunc)), i(XF_ ## x * sizeof(void *)) : $r16); + #else #error [No stub code for this arch] #endif @@ -72,6 +82,8 @@ int main(void) register volatile xxx_t *pq asm(r8); #elif defined(__mips__) register volatile xxx_t *pq asm(k0); +#elif defined(__nds32__) + register volatile xxx_t *pq asm($r16); #endif char buf[32]; -- 1.6.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 4/8] nds32: add header files support for soc ag101
Add header files support for SoC ag101. Signed-off-by: Macpaul Lin macp...@andestech.com --- arch/nds32/include/asm/arch-ag101/ag101.h | 44 ++ arch/nds32/include/asm/arch-ag101/chipset.h | 782 + arch/nds32/include/asm/arch-ag101/ftpmu010.h | 146 + arch/nds32/include/asm/arch-ag101/ftsdmc020.h | 103 arch/nds32/include/asm/arch-ag101/ftsmc020.h | 79 +++ arch/nds32/include/asm/arch-ag101/fttmr010.h | 73 +++ 6 files changed, 1227 insertions(+), 0 deletions(-) create mode 100644 arch/nds32/include/asm/arch-ag101/ag101.h create mode 100644 arch/nds32/include/asm/arch-ag101/chipset.h create mode 100644 arch/nds32/include/asm/arch-ag101/ftpmu010.h create mode 100644 arch/nds32/include/asm/arch-ag101/ftsdmc020.h create mode 100644 arch/nds32/include/asm/arch-ag101/ftsmc020.h create mode 100644 arch/nds32/include/asm/arch-ag101/fttmr010.h diff --git a/arch/nds32/include/asm/arch-ag101/ag101.h b/arch/nds32/include/asm/arch-ag101/ag101.h new file mode 100644 index 000..e0f199e --- /dev/null +++ b/arch/nds32/include/asm/arch-ag101/ag101.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2010 Andes Technology Corporation + * Macpaul Lin, Andes Technology Corporation macp...@andestech.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __AG101_H +#define __AG101_H + +/* + * Hardware register bases + */ +#define CONFIG_FTSMC020_BASE 0x9020 /* Static Memory Controller */ +#define CONFIG_DEBUG_LED 0x902c /* Debug LED */ +#define CONFIG_FTSDMC020_BASE 0x9030 /* SDRAM Controller */ + +/* Ethernet */ +/* + * Comes from Faraday CPE_110 and CPE_120 + * CPE_110: + * CONFIG_FTMAC100_BASE0x9670 + * CPE_120: (AG101) + * CONFIG_FTMAC100_BASE0x9090 + */ +#define CONFIG_FTMAC100_BASE 0x9090 + +#define CONFIG_FTPMU010_BASE 0x9810 /* Power Management Unit */ +#define CONFIG_FTTMR010_BASE 0x9840 /* Timer */ +#define CONFIG_FTRTC010_BASE 0x9860 /* Real Time Clock*/ + +#endif /* __AG101_H */ diff --git a/arch/nds32/include/asm/arch-ag101/chipset.h b/arch/nds32/include/asm/arch-ag101/chipset.h new file mode 100644 index 000..fe02571 --- /dev/null +++ b/arch/nds32/include/asm/arch-ag101/chipset.h @@ -0,0 +1,782 @@ +/* + * Copyright (C) 2010 Andes Technology Corporation + * Shawn Lin, Andes Technology Corporation nobuh...@andestech.com + * Macpaul Lin, Andes Technology Corporation macp...@andestech.com + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ +#ifndef CHIPSET_H +#define CHIPSET_H + +/* + * DO NOT EDIT!! - this file automatically generated + * from .s file by awk -f s2h.awk + */ +/*** + * Copyright Faraday Technology Corp 2002-2003. All rights reserved. * + *-* + * Name:cpe.s * + * Description: ADP_AG101 board specfic define * + * Author: Fred Chien * + *** + */ + +/* + * ADP_AG101 address map; + * + *+== + * 0x | ROM + *| + * 0x0008 |== + *| SRAM + *|== + * 0x1000 | SDRAM + * 0x8FFF | +
[U-Boot] [PATCH v2 6/8] nds32: add common support for nds32
Add support to common commands, features, image format, and common headers. Signed-off-by: Macpaul Lin macp...@andestech.com --- common/cmd_bdinfo.c| 26 ++ common/cmd_bootm.c |2 + common/image.c |1 + include/common.h | 13 +++ include/image.h|5 + include/nds32_common.h | 203 6 files changed, 250 insertions(+), 0 deletions(-) create mode 100644 include/nds32_common.h diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index fbe73f1..b65797b 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -348,6 +348,32 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; } +#elif defined(CONFIG_NDS32) + +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + int i; + bd_t *bd = gd-bd; + + print_num (arch_number, bd-bi_arch_number); + print_num (env_t, (ulong)bd-bi_env); + print_num (boot_params, (ulong)bd-bi_boot_params); + + for (i=0; iCONFIG_NR_DRAM_BANKS; ++i) { + print_num(DRAM bank, i); + print_num(- start, bd-bi_dram[i].start); + print_num(- size,bd-bi_dram[i].size); + } + +#if defined(CONFIG_CMD_NET) + print_eth(0); + printf (ip_addr = %pI4\n, bd-bi_ip_addr); +#endif + printf (baudrate= %d bps\n, bd-bi_baudrate); + + return 0; +} + #else #error a case for this architecture does not exist! #endif diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index adfa6cd..7fc2284 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -182,6 +182,8 @@ void arch_preboot_os(void) __attribute__((weak, alias(__arch_preboot_os))); #define IH_INITRD_ARCH IH_ARCH_SH #elif defined(__sparc__) #define IH_INITRD_ARCH IH_ARCH_SPARC +#elif defined(__nds32__) + #define IH_INITRD_ARCH IH_ARCH_NDS32 #else # error Unknown CPU type #endif diff --git a/common/image.c b/common/image.c index 6d8833e..ce968e2 100644 --- a/common/image.c +++ b/common/image.c @@ -93,6 +93,7 @@ static table_entry_t uimage_arch[] = { { IH_ARCH_SPARC64,sparc64, SPARC 64 Bit, }, { IH_ARCH_BLACKFIN, blackfin, Blackfin, }, { IH_ARCH_AVR32, avr32,AVR32,}, + { IH_ARCH_NDS32, nds32,NDS32,}, { -1, , , }, }; diff --git a/include/common.h b/include/common.h index eddec22..8d9c36d 100644 --- a/include/common.h +++ b/include/common.h @@ -43,6 +43,9 @@ typedef volatile unsigned charvu_char; #if defined(CONFIG_PCI) (defined(CONFIG_4xx) !defined(CONFIG_AP1000)) #include pci.h #endif +#if defined(CONFIG_NDS32) +#include nds32_common.h /* should be reference to asm/somefile.h */ +#endif #if defined(CONFIG_8xx) #include asm/8xx_immap.h #if defined(CONFIG_MPC852) || defined(CONFIG_MPC852T) || \ @@ -274,6 +277,12 @@ void forceenv (char *, char *); #ifdef CONFIG_I386 /* x86 version to be fixed! */ # include asm/u-boot-i386.h #endif /* CONFIG_I386 */ +#ifdef CONFIG_NDS32 +# include asm/mach-types.h +# include asm/setup.h +# include asm/u-boot-nds32.h /* NDS32 version to be fixed! */ +# include asm/andesboot.h +#endif /* CONFIG_NDS32 */ #ifdef CONFIG_AUTO_COMPLETE int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf); @@ -729,10 +738,14 @@ int cpu_release(int nr, int argc, char * const argv[]); #define CONFIG_HAS_POST #endif +/* CONFIG_INIT_CRITICAL is necessay to run cpu_init_crit in start.s, + or exception would rise*/ +#ifndef __nds32__ #ifdef CONFIG_INIT_CRITICAL #error CONFIG_INIT_CRITICAL is deprecated! #error Read section CONFIG_SKIP_LOWLEVEL_INIT in README. #endif +#endif #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) diff --git a/include/image.h b/include/image.h index bcc08d1..17a673d 100644 --- a/include/image.h +++ b/include/image.h @@ -105,6 +105,7 @@ #define IH_ARCH_BLACKFIN 16 /* Blackfin */ #define IH_ARCH_AVR32 17 /* AVR32*/ #define IH_ARCH_ST200 18 /* STMicroelectronics ST200 */ +#define IH_ARCH_NDS32 19 /* ANDES Technology - nds32 */ /* * Image Types @@ -500,6 +501,8 @@ static inline int image_check_target_arch (const image_header_t *hdr) if (!image_check_arch (hdr, IH_ARCH_SH)) #elif defined(__sparc__) if (!image_check_arch (hdr, IH_ARCH_SPARC)) +#elif defined(__nds32__) + if (!image_check_arch (hdr, IH_ARCH_NDS32)) #else # error Unknown CPU type #endif @@ -652,6 +655,8 @@ static inline int fit_image_check_target_arch (const void *fdt, int node) if (!fit_image_check_arch (fdt, node, IH_ARCH_SH)) #elif defined(__sparc__) if (!fit_image_check_arch (fdt, node, IH_ARCH_SPARC)) +#elif defined(__nds32__) + if
[U-Boot] [PATCH v2 8/8] ftrtc010.c : enhance code according to original datasheet
Add missing codes according to original datasheet. This patch also makes ftrtc010 could be adapted to PCLK and EXT_CLK. Signed-off-by: Macpaul Lin macp...@andestech.com --- drivers/rtc/ftrtc010.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/rtc/ftrtc010.c b/drivers/rtc/ftrtc010.c index 7738a7a..4569595 100644 --- a/drivers/rtc/ftrtc010.c +++ b/drivers/rtc/ftrtc010.c @@ -34,6 +34,13 @@ struct ftrtc010 { unsigned int alarm_hour;/* 0x18 */ unsigned int record;/* 0x1c */ unsigned int cr;/* 0x20 */ + unsigned int wsec; /* 0x24 */ + unsigned int wmin; /* 0x28 */ + unsigned int whour; /* 0x2c */ + unsigned int wday; /* 0x30 */ + unsigned int intr; /* 0x34 */ + unsigned int div; /* 0x38 */ + unsigned int rev; /* 0x3c */ }; /* @@ -85,7 +92,11 @@ int rtc_get(struct rtc_time *tmp) debug(%s(): record register: %x\n, __func__, readl(rtc-record)); +#ifdef CONFIG_PCLK + now = (ftrtc010_time() + readl(rtc-record)) / RTC_DIV_COUNT; +#else /* CONFIG_EXT_CLK */ now = ftrtc010_time() + readl(rtc-record); +#endif to_tm(now, tmp); -- 1.6.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 7/8] nds32: add board adp-ag101 support
Add adp-ag101 board related settings to u-boot. Signed-off-by: Macpaul Lin macp...@andestech.com --- MAINTAINERS | 11 ++ MAKEALL |9 + Makefile | 10 + board/AndesTech/adp-ag101/Makefile| 51 ++ board/AndesTech/adp-ag101/adp-ag101.c | 77 board/AndesTech/adp-ag101/config.mk | 42 + include/configs/adp-ag101.h | 319 + 7 files changed, 519 insertions(+), 0 deletions(-) create mode 100644 board/AndesTech/adp-ag101/Makefile create mode 100644 board/AndesTech/adp-ag101/adp-ag101.c create mode 100644 board/AndesTech/adp-ag101/config.mk create mode 100644 include/configs/adp-ag101.h diff --git a/MAINTAINERS b/MAINTAINERS index 4b91b0f..4783d93 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1039,5 +1039,16 @@ Brent Kandetzki bre...@teleco.com IP04BF532 # +# NDS32 Systems: # +# # +# Maintainer Name, Email Address # +# Board CPU # +# + +Macpaul Lin macp...@andestech.com + + ADP-AG101 N1213 (AG101 SoC) + +# # End of MAINTAINERS list # # diff --git a/MAKEALL b/MAKEALL index 2133559..c288f7b 100755 --- a/MAKEALL +++ b/MAKEALL @@ -959,6 +959,14 @@ LIST_sh= \ LIST_sparc=gr_xc3s_1500 gr_cpci_ax2000 gr_ep2s60 grsim grsim_leon2 +# +## NDS32 Systems +# + +LIST_nds32= \ + adp-ag101 \ + + #--- #- for now, just run PowerPC by default - @@ -1017,6 +1025,7 @@ do |coldfire \ |microblaze \ |mips|mips_el \ + |nds32|nds32el \ |nios2 \ |ppc|powerpc|5xx|5xxx|512x|8xx|8220|824x|8260|83xx|85xx|86xx|4xx|7xx|74xx|TSEC \ |sh|sh2|sh3|sh4 \ diff --git a/Makefile b/Makefile index 9cea069..dd03d38 100644 --- a/Makefile +++ b/Makefile @@ -497,6 +497,16 @@ lcname = $(shell echo $(1) | sed -e 's/\(.*\)_config/\L\1/') ucname = $(shell echo $(1) | sed -e 's/\(.*\)_config/\U\1/') # +# ANDES +# + +# +## NDS32 adp-ag101 (n1213h hard core SoC) +# +adp-ag101_config: unconfig + @$(MKCONFIG) $(@:_config=) nds32 n1213 $(@:_config=) AndesTech ag101 + +# # PowerPC # diff --git a/board/AndesTech/adp-ag101/Makefile b/board/AndesTech/adp-ag101/Makefile new file mode 100644 index 000..3002b6d --- /dev/null +++ b/board/AndesTech/adp-ag101/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2010 Andes Technology Corporation +# Shawn Lin, Andes Technology Corporation nobuh...@andestech.com +# Macpaul Lin, Andes Technology Corporation macp...@andestech.com +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).a + +COBJS := adp-ag101.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak $(obj).depend +
[U-Boot] [PATCH v2 0/8] NDS32: Add NDS32 architecture support to u-boot.
NDS32 is a new 32-bit RISC architecture invented by andestech.com. It has a 16-bit/32-bit mixed-length instruction set to achieve optimal system performance, code density, and power efficiency. NDS32 also provide N9, N10, N12 different CPU core families for soft-core and hard-core SoC design. Macpaul Lin (8): nds32: add support of general functions in arch lib nds32: add cpu support for nds32 arch nds32: add header files support for nds32 nds32: add header files support for soc ag101 nds32: add standalone related support for nds32 nds32: add common support for nds32 nds32: add board adp-ag101 support ftrtc010.c : enhance code according to original datasheet MAINTAINERS | 11 + MAKEALL |9 + Makefile | 10 + arch/nds32/config.mk | 34 ++ arch/nds32/cpu/Makefile | 52 ++ arch/nds32/cpu/cpu.c | 197 +++ arch/nds32/cpu/lowlevel_init.S| 159 + arch/nds32/cpu/n1213/Makefile | 51 ++ arch/nds32/cpu/n1213/ag101/Makefile | 50 ++ arch/nds32/cpu/n1213/ag101/cpu.c | 197 +++ arch/nds32/cpu/n1213/ag101/ftsmc020.c | 51 ++ arch/nds32/cpu/n1213/ag101/timer.c| 213 +++ arch/nds32/cpu/n1213/lowlevel_init.S | 159 + arch/nds32/cpu/n1213/start.S | 447 ++ arch/nds32/cpu/n1213/u-boot.lds | 68 +++ arch/nds32/cpu/start.S| 447 ++ arch/nds32/include/asm/andesboot.h| 242 arch/nds32/include/asm/arch-ag101/ag101.h | 44 ++ arch/nds32/include/asm/arch-ag101/chipset.h | 782 + arch/nds32/include/asm/arch-ag101/ftpmu010.h | 146 + arch/nds32/include/asm/arch-ag101/ftsdmc020.h | 103 arch/nds32/include/asm/arch-ag101/ftsmc020.h | 79 +++ arch/nds32/include/asm/arch-ag101/fttmr010.h | 73 +++ arch/nds32/include/asm/bitops.h | 150 + arch/nds32/include/asm/byteorder.h| 36 ++ arch/nds32/include/asm/config.h | 26 + arch/nds32/include/asm/global_data.h | 76 +++ arch/nds32/include/asm/io.h | 348 +++ arch/nds32/include/asm/mach-types.h | 29 + arch/nds32/include/asm/memory.h | 19 + arch/nds32/include/asm/posix_types.h | 84 +++ arch/nds32/include/asm/processor.h| 25 + arch/nds32/include/asm/ptrace.h | 22 + arch/nds32/include/asm/ptregs.h | 82 +++ arch/nds32/include/asm/setup.h| 272 + arch/nds32/include/asm/string.h | 57 ++ arch/nds32/include/asm/types.h| 67 +++ arch/nds32/include/asm/u-boot-nds32.h | 76 +++ arch/nds32/include/asm/u-boot.h | 69 +++ arch/nds32/include/asm/unaligned.h| 31 + arch/nds32/lib/Makefile | 52 ++ arch/nds32/lib/board.c| 452 ++ arch/nds32/lib/bootm.c| 240 arch/nds32/lib/interrupts.c | 126 board/AndesTech/adp-ag101/Makefile| 51 ++ board/AndesTech/adp-ag101/adp-ag101.c | 77 +++ board/AndesTech/adp-ag101/config.mk | 42 ++ common/cmd_bdinfo.c | 26 + common/cmd_bootm.c|2 + common/image.c|1 + drivers/rtc/ftrtc010.c| 11 + examples/standalone/nds32.lds | 64 ++ examples/standalone/stubs.c | 17 +- examples/standalone/x86-testapp.c | 12 + include/common.h | 13 + include/configs/adp-ag101.h | 319 ++ include/image.h |5 + include/nds32_common.h| 203 +++ 58 files changed, 6806 insertions(+), 1 deletions(-) create mode 100644 arch/nds32/config.mk create mode 100644 arch/nds32/cpu/Makefile create mode 100644 arch/nds32/cpu/cpu.c create mode 100644 arch/nds32/cpu/lowlevel_init.S create mode 100644 arch/nds32/cpu/n1213/Makefile create mode 100644 arch/nds32/cpu/n1213/ag101/Makefile create mode 100644 arch/nds32/cpu/n1213/ag101/cpu.c create mode 100644 arch/nds32/cpu/n1213/ag101/ftsmc020.c create mode 100644 arch/nds32/cpu/n1213/ag101/timer.c create mode 100644 arch/nds32/cpu/n1213/lowlevel_init.S create mode 100644 arch/nds32/cpu/n1213/start.S create mode 100644 arch/nds32/cpu/n1213/u-boot.lds create mode 100644 arch/nds32/cpu/start.S create mode 100644 arch/nds32/include/asm/andesboot.h create mode 100644 arch/nds32/include/asm/arch-ag101/ag101.h create mode 100644
Re: [U-Boot] [PATCH V5 4/4] edminiv2: add mvsata_ide and cmd_ide support
-Original Message- From: Albert ARIBAUD [mailto:albert.arib...@free.fr] Sent: Thursday, August 05, 2010 2:06 AM To: Prafulla Wadaskar; Wolfgang Denk Cc: u-boot@lists.denx.de; Ashish Karkare; Prabhanjan Sarnaik; prabhan...@theia.denx.de; tanmay.upadh...@einfochips.com Subject: Re: [PATCH V5 4/4] edminiv2: add mvsata_ide and cmd_ide support Some thoughts, and then a question for Wolfgang regarding IDE config macros Le 04/08/2010 08:08, Prafulla Wadaskar a écrit : I have two more suggestion, 1. put ide_preinit function in mvsata driver, define CONFIG_IDE_PREINIT in board config file This could help reducing the source code size, because then we don't need an mvsata_ide.h any more as mvsata_ide_initialize_port() would become a static function ov mvsata_ide.c, called by ide_preinit(). I vote for this approach One issue is that ide_preinit() should initialize only those ports that exist and are used in a given board. If we put it in mvsata_ide.c, then we need to rely on config macros to tell ide_preinit() where port 0 is, and if port 1 exists/is used, where it is too. Note that this info is exactly the same as that given in configs for cmd_ide. For instance, for ED Mini V2 (uses port 1 only) we'd have something like /* ATA registers base is at SATA controller base */ #define CONFIG_SYS_ATA_BASE_ADDR ORION5X_SATA_BASE /* ATA bus 0 is orion5x port 1 on ED Mini V2 */ #define CONFIG_SYS_ATA_IDE0_OFFSETORION5X_SATA_PORT1_OFFSET ... and for OpenRD, which has two SATA ports: /* ATA registers base is at SATA controller base */ #define CONFIG_SYS_ATA_BASE_ADDR KW_SATA_BASE /* ATA bus 0 is orion5x port 1 on ED Mini V2 */ #define CONFIG_SYS_ATA_IDE0_OFFSETKW_SATA_PORT0_OFFSET #define CONFIG_SYS_ATA_IDE1_OFFSETKW_SATA_PORT1_OFFSET Theoretically I should create a similar set of macros for mvsata_ide, but it seems to be that since mvsata_ide is intended to always be used along with cmd_ide, it would be simpler to use the cmd_ide macros CONFIG_SYS_ATA_x macros in mvsata_ide.c to determine port0's address and, if port1 exists, port1's address. Wolfgang, would it be allowable for mvsata_ide to use macros intended for cmd_ide? I don't think there will be any issue, let's wait for Wolfgang's feedback Regards.. Prafulla . . ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V5 4/4] edminiv2: add mvsata_ide and cmd_ide support
-Original Message- From: Albert ARIBAUD [mailto:albert.arib...@free.fr] Sent: Thursday, August 05, 2010 1:34 AM To: Albert ARIBAUD Cc: Prafulla Wadaskar; u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; tanmay.upadh...@einfochips.com Subject: Re: [PATCH V5 4/4] edminiv2: add mvsata_ide and cmd_ide support Le 04/08/2010 09:23, Albert ARIBAUD a écrit : Le 04/08/2010 08:08, Prafulla Wadaskar a écrit : 3. Instead of adding fixed 41/50 usec delay between the writes to Scontrol It would be good if you can check/poll some status bit associated with IDE controller, this will make mvsata driver rock solid on any platform. I've looked up the marvell kirkwood and orion docs for such a control bit but found none. I'll look it up again, however it might help if you can find someone inside Marvell who would, and could, provide the info. I think I've found out how it works. I initially thought the DET field in SControl was a sort of reset line, and that writing a 1 would put the controller in continuous reset and writing a 0 to put it out of reset. But actually, DET is a command field : a write of 1 starts the reset sequence immediately: the DET field of the SStatus register will go from 0 to 3 (possibly passing through 1). Then you can set SControl's DET back to 0 so that you can use the port. Thus the init sequence becomes: write 3 to SControl's IPM and 1 to DET, read SStatus until its DET field is 3, write 0 to SControl's DET. However I'll keep a timeout value in the status read loop, because you can't expect SStatus to become 3: it could stay 0 if no drive is connected, for instance. If I did not keep a timeout, u-boot would freeze. :/ Hi Albert Good findings This would be great improvement with right approach. Regards.. Prafulla . . ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot