[U-Boot] [PATCH] tools/mkenvimage.c: fix basename(3) usage
Use the POSIX variant of basename due to BSD systems (e.g. OS X) do not provide GNU version of basename(3). It is save to use the POSIX variant here cause we do never use argv[0] later on which may be modified by the basename(3) POSIX variant. On systems providing GNU variant the GNU variant should be used since string.h is included before libgen.h. Therefore let the _GNU_SOURCE as is. This patch fixes following warning (on OS X): ---8--- mkenvimage.c: In function ‘main’: mkenvimage.c:105: warning: implicit declaration of function ‘basename’ mkenvimage.c:105: warning: assignment makes pointer from integer without a cast ---8--- Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com cc: Keith Mok ek9...@gmail.com --- This was sent by Keith Mok before. Read http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/126003 tools/mkenvimage.c | 1 + 1 Datei geändert, 1 Zeile hinzugefügt(+) diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c index bfc4eb6..5521268 100644 --- a/tools/mkenvimage.c +++ b/tools/mkenvimage.c @@ -35,6 +35,7 @@ #include stdint.h #include string.h #include unistd.h +#include libgen.h #include sys/types.h #include sys/stat.h #include sys/mman.h -- 1.7.11 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] NAND DMA timed out with i.mx boot source code.
Hi: I have one board which hardware copied from mx28evk board, and compiled the source code cloned from u-boot mainline git. The rom in mx28 print 0x80508008, that is NAND DMA timed out. I compile the source from u-boot-testing, and it's no any wrong print, and the start is OK. I don't know why result in this issue. Best Regards, Alex ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] U-boot support for versatile express cortex a-15
Does u-boot support the arm board versatile express cortex A-15(V2P-CA15x2)?If not is there anyway to port it to this board? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] U-boot support for versatile express cortex a-15
Does u-boot support the arm board versatile express cortex A-15(V2P-CA15x2)?If not is there anyway to port it to this board? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] ARM CONFIG_OF_CONTROL status
On 06/28/2012 07:57 AM, Simon Glass wrote: Hi Michal, On Wed, Jun 27, 2012 at 10:50 PM, Michal Simek mon...@monstr.eu mailto:mon...@monstr.eu wrote: Hi Simon, On 06/28/2012 03:10 AM, Simon Glass wrote: Hi Michal, On Wed, Jun 27, 2012 at 7:35 AM, Michal Simek mon...@monstr.eu mailto:mon...@monstr.eu mailto:mon...@monstr.eu mailto:mon...@monstr.eu wrote: Hi Simon, On 06/27/2012 03:58 PM, Simon Glass wrote: Hi, On Wed, Jun 27, 2012 at 2:29 AM, Michal Simek mon...@monstr.eu mailto:mon...@monstr.eu mailto:mon...@monstr.eu mailto:mon...@monstr.eu mailto:mon...@monstr.eu mailto:mon...@monstr.eu mailto:mon...@monstr.eu mailto:mon...@monstr.eu wrote: Hi, can you please update me about current state of CONFIG_OF_CONTROL for ARM? Are there any other archs/boards which will use this option? Or any other git repo out of mainline u-boot? Exynos is in progress - development is happening in the Chromium tree and being upstreamed in chunks (although no fdt patches have been sent yet). ok. Has someone tried to look for devices based on compatible property? I see that in usb driver it is based on aliases which is not the best solution. U-Boot doesn't yet have a device model which would allow this in the general case. For now, drivers look for their own compatible nodes. This works well enough until we have a device model. There are other limitations also - for example USB supports only a single controller type working at one time (a restriction we may need to look at to support USB2 and USB3 together). So even if two USB drivers decided that they both found compatible nodes, only one of them could operate. So for now aliases provide just an ordering, nothing else. I have looked at the code and did some tests on Microblaze. Firstly I have tried to change emaclite ethernet initialization and I ended with this code fragment which could be broadly used by other drivers. int offset = 0; do { offset = fdt_node_offset_by_compatible(gd-fdt_blob, offset, xlnx,xps-ethernetlite-1.00.a ); You could check if offset 0 here, or !fdtdec_get_is_enabled(gd-__fdt_blob, offset) u32 rxpp = fdtdec_get_int(gd-fdt_blob, offset, xlnx,rx-ping-pong, 0); u32 txpp = fdtdec_get_int(gd-fdt_blob, offset, xlnx,tx-ping-pong, 0); u32 reg = fdtdec_get_int(gd-fdt_blob, offset, reg, 0); Maybe fdtdec_get_addr() yeah right. do { offset = fdt_node_offset_by_compatible(__gd-fdt_blob, offset, xlnx,xps-ethernetlite-1.00.a ); u32 rxpp = fdtdec_get_int(gd-fdt_blob, offset, xlnx,rx-ping-pong, 0); u32 txpp = fdtdec_get_int(gd-fdt_blob, offset, xlnx,tx-ping-pong, 0); u32 reg = fdtdec_get_addr(gd-fdt_blob, offset, reg); if (reg != FDT_ADDR_T_NONE) ret |= xilinx_emaclite_initialize(__bis, reg, txpp, rxpp); } while (offset != -1); if (reg) ret |= xilinx_emaclite_initialize(bis, reg, txpp, rxpp); } while (offset != -1); What do you think? This code is in platform file. Seems reasonable to me. ok. Also I have tested code around aliases which parse DTS aliases list for console initialization and I have also get it work for !CONSOLE_SERIAL_MULTI case. Great - I did send a patch to the list for fdt serial, but haven't really got back to it. Can you give me link to it or just subject? WIP: fdt: Add serial port controlled by device tree These are the related commits in the Chromium tree. I will get to upstreaming these at some point. 1fe36bf gen: serial: Disable FDT serial console if requested c80331f gen: Adjust fdt console to be silent if no alias present 2006b07 gen: fdt: Add serial port controlled by device tree 711f29d fixup: gen: fdt: Fix compile-time errors 0c8fc5d lost: gen: x86: Allow NS16550 driver to support IO and memory mapped reg da92af5 gen: Fix a compiler warning in serial_fdt.c ab1d572 gen: fdt: silence console in response to device tree 'silent' option 376c215 lost: gen: fdt: Add serial port controlled by device tree Can you also send me link to Chromium tree? I am going to send RFC for emaclite driver and cleanup Microblaze port. Thanks, Michal -- Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze
Re: [U-Boot] [PATCH] arm: rmobile: Add supoprt for KMC KZM-A9-GT board
Hi, Wolfgang. 2012/6/27 Wolfgang Denk w...@denx.de: Dear Nobuhiro Iwamatsu, In message cabmqnv+raovbxagnmv9vo2hyjqz7uz2-tox91qaynrwx4pq...@mail.gmail.com you wrote: ... --- /dev/null +++ b/board/kmc/kzm/lowlevel_init.S ... + and_write32 LIFEC_SEC_SRC, 0xFFE7 + + and_write32 SRCR3, 0x7FFF + and_write32 SMSTPCR2,0xFFFB + and_write32 SRCR2, 0xFFFB + write32 PLLECR, 0x + + cmp_loop PLLECR, 0x0F00, 0x + cmp_loop FRQCRB, 0x8000, 0x + + write32 PLL0CR, 0x2D00 + write32 PLL1CR, 0x1710 + write32 FRQCRB, 0x96235880 + cmp_loop FRQCRB, 0x8000, 0x + + write32 FLCKCR, 0x000B + and_write32 SMSTPCR0, 0xFFFD + + and_write32 SRCR0, 0xFFFD + write32 SMGPIOTIME, 0x0514 + write32 SMCMT2TIME, 0x0514 + write32 SMCPGTIME, 0x0514 + write32 SMSYSCTIME, 0x0514 + + write32 DVFSCR4, 0x00092000 + write32 DVFSCR5, 0x00DC + write32 PLLECR, 0x + cmp_loop PLLECR, 0x0F00, 0x + + write32 FRQCRA, 0x0012453C + write32 FRQCRB, 0x80331350 + cmp_loop FRQCRB, 0x8000, 0x + write32 FRQCRD, 0x0B0B + cmp_loop FRQCRD, 0x8000, 0x + + write32 PCLKCR, 0x0003 + write32 VCLKCR1, 0x012F + write32 VCLKCR2, 0x0119 + write32 VCLKCR3, 0x0119 + write32 ZBCKCR, 0x0002 + write32 FLCKCR, 0x0005 + write32 SD0CKCR, 0x0080 + write32 SD1CKCR, 0x0080 + write32 SD2CKCR, 0x0080 + write32 FSIACKCR, 0x003F + write32 FSIBCKCR, 0x003F + write32 SUBCKCR, 0x0080 + write32 SPUACKCR, 0x000B + write32 SPUVCKCR, 0x000B + write32 MSUCKCR, 0x013F + write32 HSICKCR, 0x0080 + write32 MFCK1CR, 0x003F + write32 MFCK2CR, 0x003F + write32 DSITCKCR, 0x0107 + write32 DSI0PCKCR, 0x0313 + write32 DSI1PCKCR, 0x130D + write32 DSI0PHYCR, 0x2A800E0E + write32 PLL0CR, 0x1E00 + write32 PLL0CR, 0x2D00 + write32 PLL1CR, 0x1710 + write32 PLL2CR, 0x2780 + write32 PLL3CR, 0x1D00 + write32 PLL0STPCR, 0x0008 + write32 PLL1STPCR, 0x000120C0 + write32 PLL2STPCR, 0x00012000 + write32 PLL3STPCR, 0x0030 + write32 PLLECR, 0x000B + cmp_loop PLLECR, 0x0B00, 0x0B00 + + write32 DVFSCR3, 0x000120F0 + write32 MPMODE, 0x0020 + write32 VREFCR, 0x028A + write32 RMSTPCR0, 0xE4628087 + write32 RMSTPCR1, 0x + write32 RMSTPCR2, 0x53FF + write32 RMSTPCR3, 0x + write32 RMSTPCR4, 0x00800D3D + write32 RMSTPCR5, 0xF3FF + write32 SMSTPCR2, 0x + write32 SRCR2, 0x0004 + and_write32 PLLECR, 0xFFF7 + cmp_loop PLLECR, 0x0800, 0x + + write32 HPBCTRL6, 0x0001 + cmp_loop HPBCTRL6, 0x0001, 0x0001 + + write32 FRQCRD, 0x1414 + cmp_loop FRQCRD, 0x8000, 0x + + write32 PLL3CR, 0x1D00 + or_write32 PLLECR, 0x0008 + cmp_loop PLLECR, 0x0800, 0x0800 + + or_write32 DLLCNT0A, 0x0002 + write32 SDGENCNTA, 0x0005 + cmp_loop SDGENCNTA, 0x, 0x + + write32 SDCR0A, 0xACC90159 + write32 SDCR1A, 0x00010059 + write32 SDWCRC0A, 0x50874114 + write32 SDWCRC1A, 0x33199B37 + write32 SDWCRC2A, 0x008F2313 + write32 SDWCR00A, 0x31020707 + write32 SDWCR01A, 0x0017040A + write32 SDWCR10A, 0x31020707 + write32 SDWCR11A, 0x0017040A + write32 SDDRVCR0A, 0x0555 + write32 SDWCR2A, 0x3000 + or_write32 SDPCRA, 0x0080 + cmp_loop SDPCRA, 0x0080, 0x0080 + write32 SDGENCNTA, 0x2710 + cmp_loop SDGENCNTA, 0x, 0x + write32 SDMRACR0A, 0x003F + write32 SDMRA1, 0x + write32 SDGENCNTA, 0x01F4 + cmp_loop SDGENCNTA, 0x, 0x +
[U-Boot] arm, da850: lcd initialization via spi
Hi all, I've ported the code from da850 evm to a AM1808-based custom board. The original u-boot version is u-boot-2011.12-rc1. The board has a LCD 240x320. Its controller is a ILI9340 and must be initialized via SPI1 interface, chip select #2, 9-bits per word. Please note that I do not need to enable the da850's embedded lcd controller (the kernel will do that), I just have to write a sequence of 9-bit commands out to the SPI. Is u-boot the right place where such a initialization has to be done ? Is there anybody out there who faced a similar problem and eventually can suggest me a reference code within u-boot ? Thanks, Gabriele ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RFC PATCH] net: emaclite: Support OF initialization
Support new CONFIG_OF_CONTROL option where device probing is done based on device tree description. Signed-off-by: Michal Simek mon...@monstr.eu --- drivers/net/xilinx_emaclite.c | 30 ++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index e1af42a..0f6807d 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c @@ -28,6 +28,9 @@ #include config.h #include malloc.h #include asm/io.h +#include fdtdec.h + +DECLARE_GLOBAL_DATA_PTR; #undef DEBUG @@ -375,3 +378,30 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr, return 1; } + +#ifdef CONFIG_OF_CONTROL +int xilinx_emaclite_init(bd_t *bis) +{ + int offset = 0; + u32 ret = 0; + u32 reg; + + do { + offset = fdt_node_offset_by_compatible(gd-fdt_blob, offset, + xlnx,xps-ethernetlite-1.00.a); + if (offset != -1) { + reg = fdtdec_get_addr(gd-fdt_blob, offset, reg); + if (reg != FDT_ADDR_T_NONE) { + u32 rxpp = fdtdec_get_int(gd-fdt_blob, offset, + xlnx,rx-ping-pong, 0); + u32 txpp = fdtdec_get_int(gd-fdt_blob, offset, + xlnx,tx-ping-pong, 0); + ret |= xilinx_emaclite_initialize(bis, reg, + txpp, rxpp); + } + } + } while (offset != -1); + + return ret; +} +#endif -- 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 2/2] AT91: at91sam9m10g45ek : Enable EHCI instead OHCI
Enable EHCI support instead OHCI Signed-off-by: Bo Shen voice.s...@atmel.com --- include/configs/at91sam9m10g45ek.h | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/include/configs/at91sam9m10g45ek.h b/include/configs/at91sam9m10g45ek.h index f8b3095..1d5fc8f 100644 --- a/include/configs/at91sam9m10g45ek.h +++ b/include/configs/at91sam9m10g45ek.h @@ -59,17 +59,6 @@ #define CONFIG_USART_BASE ATMEL_BASE_DBGU #defineCONFIG_USART_ID ATMEL_ID_SYS -/* - * This needs to be defined for the OHCI code to work but it is defined as - * ATMEL_ID_UHPHS in the CPU specific header files. - */ -#define ATMEL_ID_UHP ATMEL_ID_UHPHS - -/* - * Specify the clock enable bit in the PMC_SCER register. - */ -#define ATMEL_PMC_UHP AT91SAM926x_PMC_UHP - /* LCD */ #define CONFIG_LCD #define LCD_BPPLCD_COLOR8 @@ -147,13 +136,10 @@ #define CONFIG_RESET_PHY_R /* USB */ -#define CONFIG_USB_ATMEL -#define CONFIG_USB_OHCI_NEW +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_ATMEL +#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 2 #define CONFIG_DOS_PARTITION -#define CONFIG_SYS_USB_OHCI_CPU_INIT -#define CONFIG_SYS_USB_OHCI_REGS_BASE ATMEL_BASE_HCI -#define CONFIG_SYS_USB_OHCI_SLOT_NAME at91sam9g45 -#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2 #define CONFIG_USB_STORAGE #define CONFIG_SYS_LOAD_ADDR 0x2200 /* load address */ -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [Patch v3 1/2] Atmel : usb : add EHCI driver for Atmel SoC
Some Atmel SoC support USB EHCI, add the EHCI driver to support it. To enable the USB EHCI, add the following configuration options into board relative configuration file and remove USB OHCI options. #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_ATMEL #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 2 Signed-off-by: Bo Shen voice.s...@atmel.com --- Change since v2: Add timeout Change since v1: Add WATCHDOG_RESET to avoid infinite loop. --- drivers/usb/host/Makefile |1 + drivers/usb/host/ehci-atmel.c | 93 + 2 files changed, 94 insertions(+) create mode 100644 drivers/usb/host/ehci-atmel.c diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index 59c3e57..4547f37 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile @@ -36,6 +36,7 @@ COBJS-$(CONFIG_USB_SL811HS) += sl811-hcd.o # echi COBJS-$(CONFIG_USB_EHCI) += ehci-hcd.o COBJS-$(CONFIG_USB_EHCI_ARMADA100) += ehci-armada100.o utmi-armada100.o +COBJS-$(CONFIG_USB_EHCI_ATMEL) += ehci-atmel.o ifdef CONFIG_MPC512X COBJS-$(CONFIG_USB_EHCI_FSL) += ehci-mpc512x.o else diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c new file mode 100644 index 000..6b22f6d --- /dev/null +++ b/drivers/usb/host/ehci-atmel.c @@ -0,0 +1,93 @@ +/* + * (C) Copyright 2012 + * Atmel Semiconductor www.atmel.com + * Written-by: Bo Shen voice.s...@atmel.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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#include common.h +#include watchdog.h +#include usb.h +#include asm/io.h +#include asm/arch/hardware.h +#include asm/arch/at91_pmc.h +#include asm/arch/clk.h + +#include ehci.h +#include ehci-core.h + +/* Enable UTMI PLL time out 500us + * 10 times as datasheet specified + */ +#define EN_UPLL_TIMEOUT500UL + +int ehci_hcd_init(void) +{ + at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC; + ulong start_time, tmp_time; + + start_time = get_timer(0); + /* Enable UTMI PLL */ + writel(AT91_PMC_UPLLEN | AT91_PMC_BIASEN, pmc-uckr); + while (readl(pmc-sr) AT91_PMC_LOCKU != AT91_PMC_LOCKU) + { + WATCHDOG_RESET(); + tmp_time = get_timer(0); + if ((tmp_time - start_time) EN_UPLL_TIMEOUT) + { + printf(ERROR: failed to enable UPLL \n); + return -1; + } + } + + /* Enable USB Host clock */ + writel(1 ATMEL_ID_UHPHS, pmc-pcer); + + hccr = (struct ehci_hccr *)ATMEL_BASE_EHCI; + hcor = (struct ehci_hcor *)((uint32_t)hccr + + HC_LENGTH(ehci_readl(hccr-cr_capbase))); + + return 0; +} + +int ehci_hcd_stop(void) +{ + at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC; + ulong start_time, tmp_time; + + /* Disable USB Host Clock */ + writel(1 ATMEL_ID_UHPHS, pmc-pcdr); + + start_time = get_timer(0); + /* Disable UTMI PLL */ + writel(readl(pmc-uckr) ~AT91_PMC_UPLLEN, pmc-uckr); + while (readl(pmc-sr) AT91_PMC_LOCKU == AT91_PMC_LOCKU) + { + WATCHDOG_RESET(); + tmp_time = get_timer(0); + if ((tmp_time - start_time) EN_UPLL_TIMEOUT) + { + printf(ERROR: failed to stop UPLL \n); + return -1; + } + } + + return 0; +} -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [Patch v3 0/2] Add EHCI driver for Atmel SoC
This patch series is to add EHCI driver for Atmel SoC, and enable EHCI support in at91sam9m10g45ek board Bo Shen (2): Atmel : usb : add EHCI driver for Atmel SoC AT91: at91sam9m10g45ek : Enable EHCI instead OHCI drivers/usb/host/Makefile |1 + drivers/usb/host/ehci-atmel.c | 93 include/configs/at91sam9m10g45ek.h | 20 ++-- 3 files changed, 97 insertions(+), 17 deletions(-) create mode 100644 drivers/usb/host/ehci-atmel.c -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [Patch v3 2/2] AT91: at91sam9m10g45ek : Enable EHCI instead OHCI
Dear Bo Shen, On 28.06.2012 09:24, Bo Shen wrote: Enable EHCI support instead OHCI Signed-off-by: Bo Shen voice.s...@atmel.com I've already acked the v2. Will pick this one ASAP and push to u-boot-atmel. Best 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 v3 2/2] AT91: at91sam9m10g45ek : Enable EHCI instead OHCI
Hi Andreas, On 6/28/2012 15:40, Andreas Bießmann wrote: Dear Bo Shen, On 28.06.2012 09:24, Bo Shen wrote: Enable EHCI support instead OHCI Signed-off-by: Bo Shen voice.s...@atmel.com I've already acked the v2. Will pick this one ASAP and push to u-boot-atmel. OK! Thanks. Best regards Andreas Bießmann ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RESEND Patch v3] Atmel : usb : add EHCI driver for Atmel SoC
Some Atmel SoC support USB EHCI, add the EHCI driver to support it. To enable the USB EHCI, add the following configuration options into board relative configuration file and remove USB OHCI options. #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_ATMEL #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 2 Signed-off-by: Bo Shen voice.s...@atmel.com --- Change since v2: Add timeout and change the coding style Change since v1: Add WATCHDOG_RESET to avoid infinite loop. --- drivers/usb/host/Makefile |1 + drivers/usb/host/ehci-atmel.c | 89 + 2 files changed, 90 insertions(+) create mode 100644 drivers/usb/host/ehci-atmel.c diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index 59c3e57..4547f37 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile @@ -36,6 +36,7 @@ COBJS-$(CONFIG_USB_SL811HS) += sl811-hcd.o # echi COBJS-$(CONFIG_USB_EHCI) += ehci-hcd.o COBJS-$(CONFIG_USB_EHCI_ARMADA100) += ehci-armada100.o utmi-armada100.o +COBJS-$(CONFIG_USB_EHCI_ATMEL) += ehci-atmel.o ifdef CONFIG_MPC512X COBJS-$(CONFIG_USB_EHCI_FSL) += ehci-mpc512x.o else diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c new file mode 100644 index 000..532db22 --- /dev/null +++ b/drivers/usb/host/ehci-atmel.c @@ -0,0 +1,89 @@ +/* + * (C) Copyright 2012 + * Atmel Semiconductor www.atmel.com + * Written-by: Bo Shen voice.s...@atmel.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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#include common.h +#include watchdog.h +#include usb.h +#include asm/io.h +#include asm/arch/hardware.h +#include asm/arch/at91_pmc.h +#include asm/arch/clk.h + +#include ehci.h +#include ehci-core.h + +/* Enable UTMI PLL time out 500us + * 10 times as datasheet specified + */ +#define EN_UPLL_TIMEOUT500UL + +int ehci_hcd_init(void) +{ + at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC; + ulong start_time, tmp_time; + + start_time = get_timer(0); + /* Enable UTMI PLL */ + writel(AT91_PMC_UPLLEN | AT91_PMC_BIASEN, pmc-uckr); + while (readl(pmc-sr) AT91_PMC_LOCKU != AT91_PMC_LOCKU) { + WATCHDOG_RESET(); + tmp_time = get_timer(0); + if ((tmp_time - start_time) EN_UPLL_TIMEOUT) { + printf(ERROR: failed to enable UPLL\n); + return -1; + } + } + + /* Enable USB Host clock */ + writel(1 ATMEL_ID_UHPHS, pmc-pcer); + + hccr = (struct ehci_hccr *)ATMEL_BASE_EHCI; + hcor = (struct ehci_hcor *)((uint32_t)hccr + + HC_LENGTH(ehci_readl(hccr-cr_capbase))); + + return 0; +} + +int ehci_hcd_stop(void) +{ + at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC; + ulong start_time, tmp_time; + + /* Disable USB Host Clock */ + writel(1 ATMEL_ID_UHPHS, pmc-pcdr); + + start_time = get_timer(0); + /* Disable UTMI PLL */ + writel(readl(pmc-uckr) ~AT91_PMC_UPLLEN, pmc-uckr); + while (readl(pmc-sr) AT91_PMC_LOCKU == AT91_PMC_LOCKU) { + WATCHDOG_RESET(); + tmp_time = get_timer(0); + if ((tmp_time - start_time) EN_UPLL_TIMEOUT) { + printf(ERROR: failed to stop UPLL\n); + return -1; + } + } + + return 0; +} -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] skat91: add support for SK-AT91SAM9/SIM508 board
Dear Vladimir Zapolskiy, I'm willing to pick this into 2012.07. But I have some questions. On 12.01.2012 00:12, Vladimir Zapolskiy wrote: This change adds complete support for Starterkit SK-AT91SAM9/SIM508 board. Signed-off-by: Vladimir Zapolskiy v...@mleia.com Cc: Albert ARIBAUD albert.u.b...@aribaud.net Cc: Wolfgang Denk w...@denx.de --- Changes from v1 to v2: * make use of setbits_le32() and similar helpers * phy address is defined explicitly * removed CONFIG_EXTRA_ENV_SETTINGS MAINTAINERS|4 + board/starterkit/skat91_sim508/Makefile| 44 ++ board/starterkit/skat91_sim508/partition.c | 39 + board/starterkit/skat91_sim508/skat91_sim508.c | 122 boards.cfg |2 + include/configs/skat91_sim508.h| 178 6 files changed, 389 insertions(+), 0 deletions(-) create mode 100644 board/starterkit/skat91_sim508/Makefile create mode 100644 board/starterkit/skat91_sim508/partition.c create mode 100644 board/starterkit/skat91_sim508/skat91_sim508.c create mode 100644 include/configs/skat91_sim508.h diff --git a/MAINTAINERS b/MAINTAINERS index 4bf12b5..bcd330a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -914,6 +914,10 @@ Sughosh Ganu urwithsugh...@gmail.com hawkboard ARM926EJS (OMAP-L138) +Vladimir Zapolskiy v...@mleia.com + + skat91_sim508 ARM926EJS (AT91SAM9260 SoC) + - Unknown / orphaned boards: diff --git a/board/starterkit/skat91_sim508/Makefile b/board/starterkit/skat91_sim508/Makefile new file mode 100644 index 000..77965f8 --- /dev/null +++ b/board/starterkit/skat91_sim508/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2011 by Vladimir Zapolskiy v...@mleia.com +# Copyright (C) 2008, Guennadi Liakhovetski l...@denx.de +# +# 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., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS:= skat91_sim508.o partition.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS:= $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/starterkit/skat91_sim508/partition.c b/board/starterkit/skat91_sim508/partition.c new file mode 100644 index 000..f82046d --- /dev/null +++ b/board/starterkit/skat91_sim508/partition.c @@ -0,0 +1,39 @@ +/* + * StarterKit SK-AT91SAM9/SIM508 board support, dataflash partitions + * + * Copyright (C) 2011 Vladimir Zapolskiy v...@mleia.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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +#include common.h +#include config.h +#include asm/hardware.h +#include dataflash.h + +AT91S_DATAFLASH_INFO dataflash_info[CONFIG_SYS_MAX_DATAFLASH_BANKS]; + +struct dataflash_addr cs[CONFIG_SYS_MAX_DATAFLASH_BANKS] = { + { CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0, 0 }, +}; + +/* define the area offsets */ +dataflash_protect_t area_list[NB_DATAFLASH_AREA] = { + { 0x, 0x3FFF, FLAG_PROTECT_SET, 0, Bootstrap }, + { 0x4000, 0x7FFF,
Re: [U-Boot] NAND DMA timed out with i.mx boot source code.
Dear alex, Hi: I have one board which hardware copied from mx28evk board, and compiled the source code cloned from u-boot mainline git. The rom in mx28 print 0x80508008, that is NAND DMA timed out. I compile the source from u-boot-testing, and it's no any wrong print, and the start is OK. I don't know why result in this issue. u-boot-testing is quite ancient. But the code you're getting is during bootrom booting from NAND, not in uboot, correct? Does your nand chip have 2048b pages with 64b OOB? Did you use nand_update_full() to reload the NAND? Best Regards, Alex Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RESEND Patch v3] Atmel : usb : add EHCI driver for Atmel SoC
Dear Bo Shen, Some Atmel SoC support USB EHCI, add the EHCI driver to support it. To enable the USB EHCI, add the following configuration options into board relative configuration file and remove USB OHCI options. #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_ATMEL #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 2 Signed-off-by: Bo Shen voice.s...@atmel.com --- Change since v2: Add timeout and change the coding style Change since v1: Add WATCHDOG_RESET to avoid infinite loop. Andreas, wanna apply this? Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] arm: bugfix: save_boot_params_default accesses uninitalized stack when -O0
save_boot_params_default() in cpu.c accesses uninitialized stack area when it compiled with -O0 (not optimized). Signed-off-by: Tetsuyuki Kobayashi k...@kmckk.co.jp --- Changes for v2: - include linux/compiler.h and use __naked instead of __attribute__((naked)) arch/arm/cpu/armv7/cpu.c |4 1 file changed, 4 insertions(+) diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c index c6fa8ef..3e2a75c 100644 --- a/arch/arm/cpu/armv7/cpu.c +++ b/arch/arm/cpu/armv7/cpu.c @@ -36,9 +36,13 @@ #include asm/system.h #include asm/cache.h #include asm/armv7.h +#include linux/compiler.h +__naked /* don't save anything to stack even if compiled with -O0 */ void save_boot_params_default(u32 r0, u32 r1, u32 r2, u32 r3) { + /* stack is not yet initialized */ + asm(bx lr); } void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RESEND Patch v3] Atmel : usb : add EHCI driver for Atmel SoC
Dear Marek Vasut, On 28.06.2012 12:51, Marek Vasut wrote: Dear Bo Shen, Some Atmel SoC support USB EHCI, add the EHCI driver to support it. To enable the USB EHCI, add the following configuration options into board relative configuration file and remove USB OHCI options. #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_ATMEL #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 2 Signed-off-by: Bo Shen voice.s...@atmel.com --- Change since v2: Add timeout and change the coding style Change since v1: Add WATCHDOG_RESET to avoid infinite loop. Andreas, wanna apply this? will do, can I get your ACK? Best regards Andreas Bießmann ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] arm: bugfix: save_boot_params_default accesses uninitalized stack when -O0
save_boot_params_default() in cpu.c accesses uninitialized stack area when it compiled with -O0 (not optimized). Signed-off-by: Tetsuyuki Kobayashi k...@kmckk.co.jp --- Changes for v2: - include linux/compiler.h and use __naked instead of __attribute__((naked)) arch/arm/cpu/armv7/cpu.c |4 1 file changed, 4 insertions(+) diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c index c6fa8ef..3e2a75c 100644 --- a/arch/arm/cpu/armv7/cpu.c +++ b/arch/arm/cpu/armv7/cpu.c @@ -36,9 +36,13 @@ #include asm/system.h #include asm/cache.h #include asm/armv7.h +#include linux/compiler.h +__naked /* don't save anything to stack even if compiled with -O0 */ void save_boot_params_default(u32 r0, u32 r1, u32 r2, u32 r3) { + /* stack is not yet initialized */ + asm(bx lr); } void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RESEND Patch v3] Atmel : usb : add EHCI driver for Atmel SoC
Dear Andreas Bießmann, Dear Marek Vasut, On 28.06.2012 12:51, Marek Vasut wrote: Dear Bo Shen, Some Atmel SoC support USB EHCI, add the EHCI driver to support it. To enable the USB EHCI, add the following configuration options into board relative configuration file and remove USB OHCI options. #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_ATMEL #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 2 Signed-off-by: Bo Shen voice.s...@atmel.com --- Change since v2: Add timeout and change the coding style Change since v1: Add WATCHDOG_RESET to avoid infinite loop. Andreas, wanna apply this? will do, can I get your ACK? Definitelly Acked-by: Marek Vasut ma...@denx.de Best regards Andreas Bießmann Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] arm: bugfix: save_boot_params_default accesses uninitalized stack when -O0
I'm sorry. This post is missing In-Reply-To. I sent again. Discard this. (2012/06/28 20:17), Tetsuyuki Kobayashi wrote: save_boot_params_default() in cpu.c accesses uninitialized stack area when it compiled with -O0 (not optimized). Signed-off-by: Tetsuyuki Kobayashik...@kmckk.co.jp --- Changes for v2: - includelinux/compiler.h and use __naked instead of __attribute__((naked)) arch/arm/cpu/armv7/cpu.c |4 1 file changed, 4 insertions(+) diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c index c6fa8ef..3e2a75c 100644 --- a/arch/arm/cpu/armv7/cpu.c +++ b/arch/arm/cpu/armv7/cpu.c @@ -36,9 +36,13 @@ #includeasm/system.h #includeasm/cache.h #includeasm/armv7.h +#includelinux/compiler.h +__naked /* don't save anything to stack even if compiled with -O0 */ void save_boot_params_default(u32 r0, u32 r1, u32 r2, u32 r3) { + /* stack is not yet initialized */ + asm(bx lr); } void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Fix: AT91SAM9263 nor flash usage Fix: board doesn't boot from norflash Fix: environment can't write to flash (end address/start address not on sector boundary)
Dear Jens Scharsig, On 19.03.2012 15:26, Jens Scharsig (BuS Elektronik) wrote: Signed-off-by: Jens Scharsig (BuS Elektronik) e...@bus-elektronik.de --- include/configs/at91sam9263ek.h |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/configs/at91sam9263ek.h b/include/configs/at91sam9263ek.h index 8399246..f02f245 100644 --- a/include/configs/at91sam9263ek.h +++ b/include/configs/at91sam9263ek.h @@ -33,7 +33,11 @@ */ #include asm/hardware.h +#ifndef CONFIG_SYS_USE_BOOT_NORFLASH #define CONFIG_SYS_TEXT_BASE 0x21F0 +#else +#define CONFIG_SYS_TEXT_BASE 0x000 +#endif /* ARM asynchronous clock */ #define CONFIG_SYS_AT91_MAIN_CLOCK 16367660 /* 16.367 MHz crystal */ @@ -148,11 +152,11 @@ #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE #define CONFIG_SYS_MONITOR_LEN (256 10) #define CONFIG_ENV_IS_IN_FLASH 1 -#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x007FE000) +#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x007E) #define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR - CONFIG_ENV_SIZE) /* Address and size of Primary Environment Sector */ -#define CONFIG_ENV_SIZE 0x2000 +#define CONFIG_ENV_SIZE 0x1 #define xstr(s) str(s) #define str(s) #s applied to u-boot-atmel/master, thanks! Best 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: brocken boot message at serial line on AT91SAM9263-EK board
Dear Jens Scharsig, On 19.03.2012 15:25, Jens Scharsig (BuS Elektronik) wrote: Signed-off-by: Jens Scharsig (BuS Elektronik) e...@bus-elektronik.de --- board/atmel/at91sam9263ek/at91sam9263ek.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/board/atmel/at91sam9263ek/at91sam9263ek.c b/board/atmel/at91sam9263ek/at91sam9263ek.c index 41ec752..60ff1c0 100644 --- a/board/atmel/at91sam9263ek/at91sam9263ek.c +++ b/board/atmel/at91sam9263ek/at91sam9263ek.c @@ -254,6 +254,7 @@ int board_early_init_f(void) (1 ATMEL_ID_PIOCDE), pmc-pcer); + at91_seriald_hw_init(); return 0; } @@ -267,7 +268,6 @@ int board_init(void) /* adress of boot parameters */ gd-bd-bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; - at91_seriald_hw_init(); #ifdef CONFIG_CMD_NAND at91sam9263ek_nand_hw_init(); #endif applied to u-boot-atmel/master, thanks! Best regards Andreas Bießmann ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RESEND Patch v3] Atmel : usb : add EHCI driver for Atmel SoC
Dear Bo Shen, On 28.06.2012 09:58, Bo Shen wrote: Some Atmel SoC support USB EHCI, add the EHCI driver to support it. To enable the USB EHCI, add the following configuration options into board relative configuration file and remove USB OHCI options. #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_ATMEL #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 2 Signed-off-by: Bo Shen voice.s...@atmel.com --- Change since v2: Add timeout and change the coding style Change since v1: Add WATCHDOG_RESET to avoid infinite loop. applied to u-boot-atmel/master, thnaks! Best 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 v3 2/2] AT91: at91sam9m10g45ek : Enable EHCI instead OHCI
Dear Bo Shen, On 28.06.2012 09:24, Bo Shen wrote: Enable EHCI support instead OHCI Signed-off-by: Bo Shen voice.s...@atmel.com --- include/configs/at91sam9m10g45ek.h | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) applied to u-boot-atmel/master, thanks! Best 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 v3 1/2] Atmel : usb : add EHCI driver for Atmel SoC
Dear Bo Shen, On 28.06.2012 09:24, Bo Shen wrote: Some Atmel SoC support USB EHCI, add the EHCI driver to support it. To enable the USB EHCI, add the following configuration options into board relative configuration file and remove USB OHCI options. #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_ATMEL #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 2 Signed-off-by: Bo Shen voice.s...@atmel.com --- Change since v2: Add timeout Change since v1: Add WATCHDOG_RESET to avoid infinite loop. applied to u-boot-atmel/master, thanks! Best regards Andreas Bießmann ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] at91sam9263ek: enable useful commands
Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com cc: Stelian Pop stel...@popies.net --- include/configs/at91sam9263ek.h |2 -- 1 file changed, 2 deletions(-) diff --git a/include/configs/at91sam9263ek.h b/include/configs/at91sam9263ek.h index f2163f1..2d46502 100644 --- a/include/configs/at91sam9263ek.h +++ b/include/configs/at91sam9263ek.h @@ -108,10 +108,8 @@ * Command line configuration. */ #include config_cmd_default.h -#undef CONFIG_CMD_BDI #undef CONFIG_CMD_FPGA #undef CONFIG_CMD_IMI -#undef CONFIG_CMD_IMLS #undef CONFIG_CMD_LOADS #undef CONFIG_CMD_SOURCE -- 1.7.10 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Is it possible to boot the U-boot from the another U-boot from the flash area
Thanks Wolfgang, I have gone through the FAQ section, this FAQ only talks about the condition where the other Uboot is in RAM but what I am thinking is to boot the Uboot from the flash location by another running Uboot. for example if my board flash starts from 0xC000_ to 0xCFFF_ and the first Uboot-1 is programmed @ 0xC800_ and second Uboot-2 is programmed @0xC500_ on reset Uboot-1 starts from flash and load it self to RAM and boots up and from there is it possible to boot Uboot-2 by using * go* cmd or in any other way. Regards, ISHWAR On Wed, Jun 27, 2012 at 7:19 PM, Wolfgang Denk w...@denx.de wrote: Dear Ishwar Saunshi, In message cakd3hysshg8+xnx1yqnvddlyqupgajc-lmg1qz32cy5ebm6...@mail.gmail.com you wrote: I am really curiuos to see if U-boot can boot another version or another Uboot burnt in flash ? Its like having 2 images of U-boot which can boot each other if it is possible can any one of you hint me how I can achive this. I tried to relocate the Uboot and burned on to the flash in 2 different loacation however when I try to do go U-boot effective address it ends up in TLB error in early stage of flash execution. In general, this is not possible. This topic is covered in the FAQ here: http://www.denx.de/wiki/view/DULG/CanUBootBeConfiguredSuchThatItCanBeStartedInRAM 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 Out of register space (ugh) - vi ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] Makefile: change LIB to LIB-y
Use LIB-y and LIB-$(xxx) for appending libraries. Also allow appending to LIB-y in sub-makefiles. The top Makefile and the SPL Makefile have lines like those: ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),) LIBS-y += $(CPUDIR)/omap-common/libomap-common.o endif ifeq ($(SOC),mx5) LIBS-y += $(CPUDIR)/imx-common/libimx-common.o endif This should be done in the arch/CPU/SoC specific sub-makefiles to keep the top Makefiles clean. This patch also allows adding of new arch/CPU/SoC specific libraries in the future without touching the top Makefiles. Signed-off-by: Daniel Schwierzeck daniel.schwierz...@gmail.com --- Makefile | 144 +++ 1 file changed, 70 insertions(+), 74 deletions(-) diff --git a/Makefile b/Makefile index 0197239..cf3c56d 100644 --- a/Makefile +++ b/Makefile @@ -225,105 +225,101 @@ endif OBJS := $(addprefix $(obj),$(OBJS)) -LIBS = lib/libgeneric.o -LIBS += lib/lzma/liblzma.o -LIBS += lib/lzo/liblzo.o -LIBS += lib/zlib/libz.o -ifeq ($(CONFIG_TIZEN),y) -LIBS += lib/tizen/libtizen.o -endif -LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \ - board/$(VENDOR)/common/lib$(VENDOR).o; fi) -LIBS += $(CPUDIR)/lib$(CPU).o +HAVE_VENDOR_COMMON_LIB := $(shell [ -f board/$(VENDOR)/common/Makefile ] \ +echo y || echo n) + +LIBS-y += lib/libgeneric.o +LIBS-y += lib/lzma/liblzma.o +LIBS-y += lib/lzo/liblzo.o +LIBS-y += lib/zlib/libz.o +LIBS-$(CONFIG_TIZEN) += lib/tizen/libtizen.o +LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/lib$(VENDOR).o +LIBS-y += $(CPUDIR)/lib$(CPU).o ifdef SOC -LIBS += $(CPUDIR)/$(SOC)/lib$(SOC).o +LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o endif ifeq ($(CPU),ixp) -LIBS += arch/arm/cpu/ixp/npe/libnpe.o -endif -ifeq ($(CONFIG_OF_EMBED),y) -LIBS += dts/libdts.o +LIBS-y += arch/arm/cpu/ixp/npe/libnpe.o endif -LIBS += arch/$(ARCH)/lib/lib$(ARCH).o -LIBS += fs/cramfs/libcramfs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o \ +LIBS-$(CONFIG_OF_EMBED) += dts/libdts.o +LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o +LIBS-y += fs/cramfs/libcramfs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o \ fs/reiserfs/libreiserfs.o fs/ext2/libext2fs.o fs/yaffs2/libyaffs2.o \ fs/ubifs/libubifs.o -LIBS += net/libnet.o -LIBS += disk/libdisk.o -LIBS += drivers/bios_emulator/libatibiosemu.o -LIBS += drivers/block/libblock.o -LIBS += drivers/dma/libdma.o -LIBS += drivers/fpga/libfpga.o -LIBS += drivers/gpio/libgpio.o -LIBS += drivers/hwmon/libhwmon.o -LIBS += drivers/i2c/libi2c.o -LIBS += drivers/input/libinput.o -LIBS += drivers/misc/libmisc.o -LIBS += drivers/mmc/libmmc.o -LIBS += drivers/mtd/libmtd.o -LIBS += drivers/mtd/nand/libnand.o -LIBS += drivers/mtd/onenand/libonenand.o -LIBS += drivers/mtd/ubi/libubi.o -LIBS += drivers/mtd/spi/libspi_flash.o -LIBS += drivers/net/libnet.o -LIBS += drivers/net/phy/libphy.o -LIBS += drivers/pci/libpci.o -LIBS += drivers/pcmcia/libpcmcia.o -LIBS += drivers/power/libpower.o -LIBS += drivers/spi/libspi.o +LIBS-y += net/libnet.o +LIBS-y += disk/libdisk.o +LIBS-y += drivers/bios_emulator/libatibiosemu.o +LIBS-y += drivers/block/libblock.o +LIBS-y += drivers/dma/libdma.o +LIBS-y += drivers/fpga/libfpga.o +LIBS-y += drivers/gpio/libgpio.o +LIBS-y += drivers/hwmon/libhwmon.o +LIBS-y += drivers/i2c/libi2c.o +LIBS-y += drivers/input/libinput.o +LIBS-y += drivers/misc/libmisc.o +LIBS-y += drivers/mmc/libmmc.o +LIBS-y += drivers/mtd/libmtd.o +LIBS-y += drivers/mtd/nand/libnand.o +LIBS-y += drivers/mtd/onenand/libonenand.o +LIBS-y += drivers/mtd/ubi/libubi.o +LIBS-y += drivers/mtd/spi/libspi_flash.o +LIBS-y += drivers/net/libnet.o +LIBS-y += drivers/net/phy/libphy.o +LIBS-y += drivers/pci/libpci.o +LIBS-y += drivers/pcmcia/libpcmcia.o +LIBS-y += drivers/power/libpower.o +LIBS-y += drivers/spi/libspi.o ifeq ($(CPU),mpc83xx) -LIBS += drivers/qe/libqe.o -LIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o -LIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o +LIBS-y += drivers/qe/libqe.o +LIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o +LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o endif ifeq ($(CPU),mpc85xx) -LIBS += drivers/qe/libqe.o -LIBS += drivers/net/fm/libfm.o -LIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o -LIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o +LIBS-y += drivers/qe/libqe.o +LIBS-y += drivers/net/fm/libfm.o +LIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o +LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o endif ifeq ($(CPU),mpc86xx) -LIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o -LIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o -endif -LIBS += drivers/rtc/librtc.o -LIBS += drivers/serial/libserial.o -ifeq ($(CONFIG_GENERIC_LPC_TPM),y) -LIBS += drivers/tpm/libtpm.o -endif -LIBS += drivers/twserial/libtws.o -LIBS += drivers/usb/eth/libusb_eth.o -LIBS += drivers/usb/gadget/libusb_gadget.o -LIBS += drivers/usb/host/libusb_host.o -LIBS += drivers/usb/musb/libusb_musb.o -LIBS += drivers/usb/phy/libusb_phy.o -LIBS +=
[U-Boot] [PATCH] ehci-atmel: fix compiler warning
Commit f61483c539439d32278faec62753811734737cce intoduced following warning: ---8--- ehci-atmel.c: In function 'ehci_hcd_init': ehci-atmel.c:49:2: warning: suggest parentheses around comparison in operand of '' [-Wparentheses] ehci-atmel.c: In function 'ehci_hcd_stop': ehci-atmel.c:79:2: warning: suggest parentheses around comparison in operand of '' [-Wparentheses] ---8--- This patch fixes it. Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com cc: Bo Shen voice.s...@atmel.com cc: Marek Vasut ma...@denx.de --- I'm really sorry, should have run the compile check before submission. This warning was introduced in v3, it was not there in v2. Maybe there was a misunderstanding between you Marek and you Bo. I will apply this patch immidiately. Best regards Andreas Bießmann drivers/usb/host/ehci-atmel.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c index 532db22..15b9b60 100644 --- a/drivers/usb/host/ehci-atmel.c +++ b/drivers/usb/host/ehci-atmel.c @@ -46,7 +46,7 @@ int ehci_hcd_init(void) start_time = get_timer(0); /* Enable UTMI PLL */ writel(AT91_PMC_UPLLEN | AT91_PMC_BIASEN, pmc-uckr); - while (readl(pmc-sr) AT91_PMC_LOCKU != AT91_PMC_LOCKU) { + while ((readl(pmc-sr) AT91_PMC_LOCKU) != AT91_PMC_LOCKU) { WATCHDOG_RESET(); tmp_time = get_timer(0); if ((tmp_time - start_time) EN_UPLL_TIMEOUT) { @@ -76,7 +76,7 @@ int ehci_hcd_stop(void) start_time = get_timer(0); /* Disable UTMI PLL */ writel(readl(pmc-uckr) ~AT91_PMC_UPLLEN, pmc-uckr); - while (readl(pmc-sr) AT91_PMC_LOCKU == AT91_PMC_LOCKU) { + while ((readl(pmc-sr) AT91_PMC_LOCKU) == AT91_PMC_LOCKU) { WATCHDOG_RESET(); tmp_time = get_timer(0); if ((tmp_time - start_time) EN_UPLL_TIMEOUT) { -- 1.7.10 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] i.MX6Q SabreLite: Ethernet does not work at Gigabit speed
Hi, I just realized that I cannot download files on a Gitabit Ethernet network. I'm getting timeouts: MX6QSABRELITE U-Boot boot Using FEC device TFTP from server 172.16.0.1; our IP address is 172.16.0.100 Filename 'wolf/uImage-mx6q-mainline'. Load address: 0x1080 Loading: error frame: 0x4fd76ca0 0x0804 T error frame: 0x4fd77f00 0x0804 Before I start digging, is this a known issue? Wolfgang. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/8] EXT2 cleanup
Marek, On Sun, Jun 17, 2012 at 05:12:32PM +0200, Marek Vasut wrote: Dear Wolfgang Denk, So, I cleaned up the ext2 filesystem code a bit. I tried to separate the changes to increase the reviewability. Marek Vasut (8): EXT2: Indent cleanup of dev.c EXT2: Indent cleanup ext2fs.c EXT2: Rework ext2fs_blockgroup() function EXT2: Rework ext2fs_read_file() EXT2: Rework ext2fs_read_symlink() EXT2: Rework ext2fs_find_file1() EXT2: Rework ext2fs_iterate_dir() EXT2: Rework ext2fs_read_block() fs/ext2/dev.c| 74 +++--- fs/ext2/ext2fs.c | 775 +++--- 2 files changed, 416 insertions(+), 433 deletions(-) I see no objections, can we apply these please? I apologize for the late reply on this. It looks as though it hasn't been pulled in yet. My ext2load speedup patch is in Wolgang's master tree, could you rebase this series against that and resubmit? I'm rebuilding my dreamplug from u-boot on up and would like to test your series while I have it torn apart. (then, onto kernel testing). thx, Jason. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] ARM: increase lmb stack space reservation to 4KB
From: Rob Herring rob.herr...@calxeda.com The bootm initrd image copy to ram can collide with the stack in cases where the print buffer size is large (i.e. 1K). The result is intermittent initrd decompression errors depending on the initrd size MOD 4KB since the initrd start address is 4KB aligned. Cc: Albert ARIBAUD albert.u.b...@aribaud.net Signed-off-by: Rob Herring rob.herr...@calxeda.com --- arch/arm/lib/bootm.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 599547d..999f201 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -69,8 +69,8 @@ void arch_lmb_reserve(struct lmb *lmb) sp = get_sp(); debug(## Current stack ends at 0x%08lx , sp); - /* adjust sp by 1K to be safe */ - sp -= 1024; + /* adjust sp by 4K to be safe */ + sp -= 4096; lmb_reserve(lmb, sp, gd-bd-bi_dram[0].start + gd-bd-bi_dram[0].size - sp); } -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 3/6] mcx: Disable DCACHE since USB EHCI is enabled
Dear Marek, 28.06.2012 02:48, Marek Vasut wrote: Sorry for missing this discussion. I think compile-time disabling of the cache is too brutal. ehci-hcd cache handling is broken anyway: doing unaligned flushes/invalidates is a bug, and we know for sure that upper layers don't care about alignment (and I bet ehci-hcd does this even for its internal buffers). So what's the point in all this cache handling in ehci-hcd? It's not going to work anyway and just produces problems. So I suggest to just disable all this stuff until generic code will be fixed. Alternatively we can do bounce-buffering inside driver. We should rather introduce generic bounce buffer. But the upper layers are getting fixed recently so we should be getting there. Really? Don't forget my old patch [1] then ;) Still I think we should rip off all the cache stuff from ehci-hcd until all patches for upper layers are included. Again, this stuff doesn't do proper things now anyway and USB won't work with dcache enabled. BTW, I think this was under #ifdef CONFIG_EHCI_DCACHE last time looked at it. Was this changed by your commit? I think that's the source of the problem this series tries to address: you've taken buggy code out of #ifdef ;) I think it's better to just put it back until upper layers won't be fixed. Regards, Ilya. [1] http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/114235 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 0/9] feature additions and fixes for da850/omap-l138
Hi Tom, hi Prabhakar, On Mon, Jun 25, 2012 at 6:46 PM, Tom Rini tr...@ti.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/25/2012 12:35 AM, Prabhakar Lad wrote: From: Lad, Prabhakar prabhakar@ti.com This series adds MMC/SD, NAND and NOR SPL support for Logic PD's DA850/OMAP-L138 EVM. This series also fixes some issues found on the EVM during testing. The patches are sent in a series as these patches need to be applied in the order they are sent. The V2 version of patch series has been tested by Sughosh Ganu(urwithsugh...@gmail.com) and V3 version of the patch series has been tested by Christian Riesch (christian.rie...@omicron.at) for regression. Changes for v2: 1: Fixed comments from Tom to remove unused macro and add comment. 2: Fixed comments from Christian to move GPIO pins to board file and add a check to perform initializations only when CONFIG_SPL_LIBCOMMON_SUPPORT is defined. Changes for v3: 1: Fixed comments from Christian, to define CONFIG_SPL_MMC_LOAD config while booting from MMC. 2: Splitted patch 5(of v2), one for CONFIG_SPL_LIBCOMMON_SUPPORT check, one to define SPI specific configs of SP only when SPI flash is used and lastly to add NAND SPL support. 3: Rearranged the patch sequence. Changes for v4: 1: Fixed comment from Christian, to use clrbits_le32() which was wrongly using clrbits_be32(). Under the assumption that Christian will be providing acks soon when he can test the patches, I've staged this to my local u-boot-ti/next and confirmed everything is still bisect'able. Thanks for working through the iterations on this series! I tested v4 of the patchset on the AM1808 experimenter's kit (da850evm configuration, make u-boot.ais, booting from SPI flash with SPL) and on the calimain board. I found no regression due to this patchset. Tested-by: Christian Riesch christian.rie...@omicron.at Regards, Christian ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] i2c: deblock i2c bus also if accessed before realocation
If we switch to a different i2c bus in changing the mux config for the i2c mux, we have to be sure to deblock the bus also before realocation. Signed-off-by: Holger Brunck holger.bru...@keymile.com cc: Heiko Schocher h...@denx.de cc: Valentin Longchamp valentin.longch...@keymile.com --- common/cmd_i2c.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index 2cdc4ed..795814d 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -1445,6 +1445,7 @@ int i2c_mux_ident_muxstring_f (uchar *buf) oldpos = pos; } + i2c_init_board(); return 0; } -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/8] EXT2 cleanup
Dear Jason Cooper, Marek, On Sun, Jun 17, 2012 at 05:12:32PM +0200, Marek Vasut wrote: Dear Wolfgang Denk, So, I cleaned up the ext2 filesystem code a bit. I tried to separate the changes to increase the reviewability. Marek Vasut (8): EXT2: Indent cleanup of dev.c EXT2: Indent cleanup ext2fs.c EXT2: Rework ext2fs_blockgroup() function EXT2: Rework ext2fs_read_file() EXT2: Rework ext2fs_read_symlink() EXT2: Rework ext2fs_find_file1() EXT2: Rework ext2fs_iterate_dir() EXT2: Rework ext2fs_read_block() fs/ext2/dev.c| 74 +++--- fs/ext2/ext2fs.c | 775 +++--- 2 files changed, 416 insertions(+), 433 deletions(-) I see no objections, can we apply these please? I apologize for the late reply on this. It looks as though it hasn't been pulled in yet. My ext2load speedup patch is in Wolgang's master tree, could you rebase this series against that and resubmit? I'm rebuilding my dreamplug from u-boot on up and would like to test your series while I have it torn apart. (then, onto kernel testing). Yes, when I get better. Or do you want to pick these, rework and resubmit? thx, Jason. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/8] EXT2 cleanup
Dear Jason Cooper, On Thu, Jun 28, 2012 at 04:35:24PM +0200, Marek Vasut wrote: Dear Jason Cooper, Marek, On Sun, Jun 17, 2012 at 05:12:32PM +0200, Marek Vasut wrote: Dear Wolfgang Denk, So, I cleaned up the ext2 filesystem code a bit. I tried to separate the changes to increase the reviewability. Marek Vasut (8): EXT2: Indent cleanup of dev.c EXT2: Indent cleanup ext2fs.c EXT2: Rework ext2fs_blockgroup() function EXT2: Rework ext2fs_read_file() EXT2: Rework ext2fs_read_symlink() EXT2: Rework ext2fs_find_file1() EXT2: Rework ext2fs_iterate_dir() EXT2: Rework ext2fs_read_block() fs/ext2/dev.c| 74 +++--- fs/ext2/ext2fs.c | 775 +++--- 2 files changed, 416 insertions(+), 433 deletions(-) I see no objections, can we apply these please? I apologize for the late reply on this. It looks as though it hasn't been pulled in yet. My ext2load speedup patch is in Wolgang's master tree, could you rebase this series against that and resubmit? I'm rebuilding my dreamplug from u-boot on up and would like to test your series while I have it torn apart. (then, onto kernel testing). Yes, when I get better. Or do you want to pick these, rework and resubmit? Sure, no problem. Hope you get better soon. I'll post a v2 if there are no glaring issues. Thanks! Keep me in CC :) thx, Jason. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 3/6] mcx: Disable DCACHE since USB EHCI is enabled
Dear Marek, 28.06.2012 18:37, Marek Vasut wrote: Really? Don't forget my old patch [1] then ;) Still I think we should rip off all the cache stuff from ehci-hcd until all patches for upper layers are included. Again, this stuff doesn't do proper things now anyway and USB won't work with dcache enabled. Have you tested? I enabled dcache on m28 and tried asix ethernet (needed a Surely. (but that probably was an AM3517 with 64 byte cache line) patch) and loading from ext2 and vfat (worked). This is just a coincedence ;) Regards, Ilya. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] arm: bugfix: save_boot_params_default accesses uninitalized stack when -O0
On 06/28/2012 04:35 AM, Tetsuyuki Kobayashi wrote: save_boot_params_default() in cpu.c accesses uninitialized stack area when it compiled with -O0 (not optimized). Signed-off-by: Tetsuyuki Kobayashi k...@kmckk.co.jp --- Changes for v2: - include linux/compiler.h and use __naked instead of __attribute__((naked)) arch/arm/cpu/armv7/cpu.c |4 1 file changed, 4 insertions(+) diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c index c6fa8ef..3e2a75c 100644 --- a/arch/arm/cpu/armv7/cpu.c +++ b/arch/arm/cpu/armv7/cpu.c @@ -36,9 +36,13 @@ #include asm/system.h #include asm/cache.h #include asm/armv7.h +#include linux/compiler.h +__naked /* don't save anything to stack even if compiled with -O0 */ void save_boot_params_default(u32 r0, u32 r1, u32 r2, u32 r3) The usual form (here and kernel) is: void __naked save_boot_params_default(...) Same for __weak and so on. Thanks! -- Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] ATMEL/PIO: Enable new feature of PIO on Atmel device
Dear Bo Shen, On 21.05.2012 03:50, Bo Shen wrote: Enable new PIO feature supported by Atmel SoC. Using CPU_HAS_PIO3 micro to enable PIO new feature. Signed-off-by: Bo Shen voice.s...@atmel.com --- Changes since v1: - remove the legacy interface. Changes since v2: - keep the legacy interface, don't touch it. arch/arm/include/asm/arch-at91/at91_pio.h | 45 ++- drivers/gpio/at91_gpio.c | 125 - 2 files changed, 167 insertions(+), 3 deletions(-) applied to u-boot-atmel/master, thanks! Best 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] Makefile: change LIB to LIB-y
Dear Daniel Schwierzeck, In message 1340887200-535-1-git-send-email-daniel.schwierz...@gmail.com you wrote: Use LIB-y and LIB-$(xxx) for appending libraries. Also allow appending to LIB-y in sub-makefiles. The top Makefile and the SPL Makefile have lines like those: ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),) LIBS-y += $(CPUDIR)/omap-common/libomap-common.o endif ifeq ($(SOC),mx5) LIBS-y += $(CPUDIR)/imx-common/libimx-common.o endif This should be done in the arch/CPU/SoC specific sub-makefiles to keep the top Makefiles clean. This patch also allows adding of new arch/CPU/SoC specific libraries in the future without touching the top Makefiles. Please split into two patches: one that introduces LIBS-y, and another one, that adds the extensions. 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 Nobody will ever need more than 640k RAM! -- Bill Gates, 1981 Windows 95 needs at least 8 MB RAM. -- Bill Gates, 1996 Nobody will ever need Windows 95. -- logical conclusion ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 3/6] mcx: Disable DCACHE since USB EHCI is enabled
Dear Ilya Yanok, Dear Marek, 28.06.2012 18:37, Marek Vasut wrote: Really? Don't forget my old patch [1] then ;) Still I think we should rip off all the cache stuff from ehci-hcd until all patches for upper layers are included. Again, this stuff doesn't do proper things now anyway and USB won't work with dcache enabled. Have you tested? I enabled dcache on m28 and tried asix ethernet (needed a Surely. (but that probably was an AM3517 with 64 byte cache line) m28 is imx28 with 32byte cacheline patch) and loading from ext2 and vfat (worked). This is just a coincedence ;) Not really, did you check mainline uboot and the fixes in those? Regards, Ilya. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] beagle: add eeprom expansion board info for bct brettl4
this is for a prototyping board vendor/product ids have been added to http://elinux.org/BeagleBoardPinMux#List_of_Vendor_and_Device_IDs Signed-off-by: Peter Meerwald p.meerw...@bct-electronic.com --- board/ti/beagle/beagle.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index 9edd3c5..2ef2290 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -68,6 +68,7 @@ #define BBTOYS_VGA 0x02000B00 #define BBTOYS_LCD 0x03000B00 #define BCT_BRETTL30x01000F00 +#define BCT_BRETTL40x02000F00 #define BEAGLE_NO_EEPROM 0x DECLARE_GLOBAL_DATA_PTR; @@ -417,8 +418,11 @@ int misc_init_r(void) printf(Recognized BeagleBoardToys LCD board\n); break;; case BCT_BRETTL3: - printf(Recognized bct electronic GmbH brettl3 board\n); - break; + printf(Recognized bct electronic GmbH brettl3 board\n); + break; + case BCT_BRETTL4: + printf(Recognized bct electronic GmbH brettl4 board\n); + break; case BEAGLE_NO_EEPROM: printf(No EEPROM on expansion board\n); setenv(buddy, none); -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] arm: bugfix: save_boot_params_default accesses uninitalized stack when -O0
On 2012/06/28, at 23:57, Tom Rini wrote: On 06/28/2012 04:35 AM, Tetsuyuki Kobayashi wrote: save_boot_params_default() in cpu.c accesses uninitialized stack area when it compiled with -O0 (not optimized). Signed-off-by: Tetsuyuki Kobayashi k...@kmckk.co.jp --- Changes for v2: - include linux/compiler.h and use __naked instead of __attribute__((naked)) arch/arm/cpu/armv7/cpu.c |4 1 file changed, 4 insertions(+) diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c index c6fa8ef..3e2a75c 100644 --- a/arch/arm/cpu/armv7/cpu.c +++ b/arch/arm/cpu/armv7/cpu.c @@ -36,9 +36,13 @@ #include asm/system.h #include asm/cache.h #include asm/armv7.h +#include linux/compiler.h +__naked /* don't save anything to stack even if compiled with -O0 */ void save_boot_params_default(u32 r0, u32 r1, u32 r2, u32 r3) The usual form (here and kernel) is: void __naked save_boot_params_default(...) Same for __weak and so on. Thanks! Oh, I should grep __naked before posting this. I will try V3. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/3] Makefile: allow appending to LIB in sub-makefiles
The top Makefile and the SPL Makefile have lines like those: ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),) LIBS += $(CPUDIR)/omap-common/libomap-common.o endif ifeq ($(SOC),mx5) LIBS += $(CPUDIR)/imx-common/libimx-common.o endif This should be done in the arch/CPU/SoC specific sub-makefiles to keep the top Makefiles clean. This patch also allows adding of new arch/CPU/SoC specific libraries in the future without touching the top Makefiles. Signed-off-by: Daniel Schwierzeck daniel.schwierz...@gmail.com --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0197239..b5fafc7 100644 --- a/Makefile +++ b/Makefile @@ -225,7 +225,7 @@ endif OBJS := $(addprefix $(obj),$(OBJS)) -LIBS = lib/libgeneric.o +LIBS += lib/libgeneric.o LIBS += lib/lzma/liblzma.o LIBS += lib/lzo/liblzo.o LIBS += lib/zlib/libz.o -- 1.7.11.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/3] Makefile: replace LIBS by LIBS-y
Synchronize with ALL-y handling and code in spl/Makefile. Signed-off-by: Daniel Schwierzeck daniel.schwierz...@gmail.com --- Makefile | 134 +++ 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/Makefile b/Makefile index b5fafc7..2bde73c 100644 --- a/Makefile +++ b/Makefile @@ -225,105 +225,105 @@ endif OBJS := $(addprefix $(obj),$(OBJS)) -LIBS += lib/libgeneric.o -LIBS += lib/lzma/liblzma.o -LIBS += lib/lzo/liblzo.o -LIBS += lib/zlib/libz.o +LIBS-y += lib/libgeneric.o +LIBS-y += lib/lzma/liblzma.o +LIBS-y += lib/lzo/liblzo.o +LIBS-y += lib/zlib/libz.o ifeq ($(CONFIG_TIZEN),y) -LIBS += lib/tizen/libtizen.o +LIBS-y += lib/tizen/libtizen.o endif -LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \ +LIBS-y += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \ board/$(VENDOR)/common/lib$(VENDOR).o; fi) -LIBS += $(CPUDIR)/lib$(CPU).o +LIBS-y += $(CPUDIR)/lib$(CPU).o ifdef SOC -LIBS += $(CPUDIR)/$(SOC)/lib$(SOC).o +LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o endif ifeq ($(CPU),ixp) -LIBS += arch/arm/cpu/ixp/npe/libnpe.o +LIBS-y += arch/arm/cpu/ixp/npe/libnpe.o endif ifeq ($(CONFIG_OF_EMBED),y) -LIBS += dts/libdts.o +LIBS-y += dts/libdts.o endif -LIBS += arch/$(ARCH)/lib/lib$(ARCH).o -LIBS += fs/cramfs/libcramfs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o \ +LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o +LIBS-y += fs/cramfs/libcramfs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o \ fs/reiserfs/libreiserfs.o fs/ext2/libext2fs.o fs/yaffs2/libyaffs2.o \ fs/ubifs/libubifs.o -LIBS += net/libnet.o -LIBS += disk/libdisk.o -LIBS += drivers/bios_emulator/libatibiosemu.o -LIBS += drivers/block/libblock.o -LIBS += drivers/dma/libdma.o -LIBS += drivers/fpga/libfpga.o -LIBS += drivers/gpio/libgpio.o -LIBS += drivers/hwmon/libhwmon.o -LIBS += drivers/i2c/libi2c.o -LIBS += drivers/input/libinput.o -LIBS += drivers/misc/libmisc.o -LIBS += drivers/mmc/libmmc.o -LIBS += drivers/mtd/libmtd.o -LIBS += drivers/mtd/nand/libnand.o -LIBS += drivers/mtd/onenand/libonenand.o -LIBS += drivers/mtd/ubi/libubi.o -LIBS += drivers/mtd/spi/libspi_flash.o -LIBS += drivers/net/libnet.o -LIBS += drivers/net/phy/libphy.o -LIBS += drivers/pci/libpci.o -LIBS += drivers/pcmcia/libpcmcia.o -LIBS += drivers/power/libpower.o -LIBS += drivers/spi/libspi.o +LIBS-y += net/libnet.o +LIBS-y += disk/libdisk.o +LIBS-y += drivers/bios_emulator/libatibiosemu.o +LIBS-y += drivers/block/libblock.o +LIBS-y += drivers/dma/libdma.o +LIBS-y += drivers/fpga/libfpga.o +LIBS-y += drivers/gpio/libgpio.o +LIBS-y += drivers/hwmon/libhwmon.o +LIBS-y += drivers/i2c/libi2c.o +LIBS-y += drivers/input/libinput.o +LIBS-y += drivers/misc/libmisc.o +LIBS-y += drivers/mmc/libmmc.o +LIBS-y += drivers/mtd/libmtd.o +LIBS-y += drivers/mtd/nand/libnand.o +LIBS-y += drivers/mtd/onenand/libonenand.o +LIBS-y += drivers/mtd/ubi/libubi.o +LIBS-y += drivers/mtd/spi/libspi_flash.o +LIBS-y += drivers/net/libnet.o +LIBS-y += drivers/net/phy/libphy.o +LIBS-y += drivers/pci/libpci.o +LIBS-y += drivers/pcmcia/libpcmcia.o +LIBS-y += drivers/power/libpower.o +LIBS-y += drivers/spi/libspi.o ifeq ($(CPU),mpc83xx) -LIBS += drivers/qe/libqe.o -LIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o -LIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o +LIBS-y += drivers/qe/libqe.o +LIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o +LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o endif ifeq ($(CPU),mpc85xx) -LIBS += drivers/qe/libqe.o -LIBS += drivers/net/fm/libfm.o -LIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o -LIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o +LIBS-y += drivers/qe/libqe.o +LIBS-y += drivers/net/fm/libfm.o +LIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o +LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o endif ifeq ($(CPU),mpc86xx) -LIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o -LIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o +LIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o +LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o endif -LIBS += drivers/rtc/librtc.o -LIBS += drivers/serial/libserial.o +LIBS-y += drivers/rtc/librtc.o +LIBS-y += drivers/serial/libserial.o ifeq ($(CONFIG_GENERIC_LPC_TPM),y) -LIBS += drivers/tpm/libtpm.o -endif -LIBS += drivers/twserial/libtws.o -LIBS += drivers/usb/eth/libusb_eth.o -LIBS += drivers/usb/gadget/libusb_gadget.o -LIBS += drivers/usb/host/libusb_host.o -LIBS += drivers/usb/musb/libusb_musb.o -LIBS += drivers/usb/phy/libusb_phy.o -LIBS += drivers/usb/ulpi/libusb_ulpi.o -LIBS += drivers/video/libvideo.o -LIBS += drivers/watchdog/libwatchdog.o -LIBS += common/libcommon.o -LIBS += lib/libfdt/libfdt.o -LIBS += api/libapi.o -LIBS += post/libpost.o +LIBS-y += drivers/tpm/libtpm.o +endif +LIBS-y += drivers/twserial/libtws.o +LIBS-y += drivers/usb/eth/libusb_eth.o +LIBS-y += drivers/usb/gadget/libusb_gadget.o +LIBS-y += drivers/usb/host/libusb_host.o +LIBS-y += drivers/usb/musb/libusb_musb.o +LIBS-y += drivers/usb/phy/libusb_phy.o +LIBS-y +=
[U-Boot] [PATCH 3/3] Makefile: cosmetic: optimize usage of LIBS-y
Signed-off-by: Daniel Schwierzeck daniel.schwierz...@gmail.com --- Makefile | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 2bde73c..cf3c56d 100644 --- a/Makefile +++ b/Makefile @@ -225,15 +225,15 @@ endif OBJS := $(addprefix $(obj),$(OBJS)) +HAVE_VENDOR_COMMON_LIB := $(shell [ -f board/$(VENDOR)/common/Makefile ] \ +echo y || echo n) + LIBS-y += lib/libgeneric.o LIBS-y += lib/lzma/liblzma.o LIBS-y += lib/lzo/liblzo.o LIBS-y += lib/zlib/libz.o -ifeq ($(CONFIG_TIZEN),y) -LIBS-y += lib/tizen/libtizen.o -endif -LIBS-y += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \ - board/$(VENDOR)/common/lib$(VENDOR).o; fi) +LIBS-$(CONFIG_TIZEN) += lib/tizen/libtizen.o +LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/lib$(VENDOR).o LIBS-y += $(CPUDIR)/lib$(CPU).o ifdef SOC LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o @@ -241,9 +241,7 @@ endif ifeq ($(CPU),ixp) LIBS-y += arch/arm/cpu/ixp/npe/libnpe.o endif -ifeq ($(CONFIG_OF_EMBED),y) -LIBS-y += dts/libdts.o -endif +LIBS-$(CONFIG_OF_EMBED) += dts/libdts.o LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o LIBS-y += fs/cramfs/libcramfs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o \ fs/reiserfs/libreiserfs.o fs/ext2/libext2fs.o fs/yaffs2/libyaffs2.o \ @@ -288,9 +286,7 @@ LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o endif LIBS-y += drivers/rtc/librtc.o LIBS-y += drivers/serial/libserial.o -ifeq ($(CONFIG_GENERIC_LPC_TPM),y) -LIBS-y += drivers/tpm/libtpm.o -endif +LIBS-$(CONFIG_GENERIC_LPC_TPM) += drivers/tpm/libtpm.o LIBS-y += drivers/twserial/libtws.o LIBS-y += drivers/usb/eth/libusb_eth.o LIBS-y += drivers/usb/gadget/libusb_gadget.o -- 1.7.11.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/3] replace LIBS by LIBS-y and allow appending to it in sub-makefiles
The top Makefile and the SPL Makefile have lines like those: ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),) LIBS += $(CPUDIR)/omap-common/libomap-common.o endif ifeq ($(SOC),mx5) LIBS += $(CPUDIR)/imx-common/libimx-common.o endif This should be done in the arch/CPU/SoC specific sub-makefiles to keep the top Makefiles clean. This patch also allows adding of new arch/CPU/SoC specific libraries in the future without touching the top Makefiles. This series splits the patch in http://patchwork.ozlabs.org/patch/167866/ as demanded by Wolfgang. Daniel Schwierzeck (3): Makefile: allow appending to LIB in sub-makefiles Makefile: replace LIBS by LIBS-y Makefile: cosmetic: optimize usage of LIBS-y Makefile | 144 +++ 1 file changed, 70 insertions(+), 74 deletions(-) -- 1.7.11.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 3/6] mcx: Disable DCACHE since USB EHCI is enabled
On 06/28/2012 07:37 AM, Marek Vasut wrote: Dear Ilya Yanok, Dear Marek, 28.06.2012 02:48, Marek Vasut wrote: Sorry for missing this discussion. I think compile-time disabling of the cache is too brutal. ehci-hcd cache handling is broken anyway: doing unaligned flushes/invalidates is a bug, and we know for sure that upper layers don't care about alignment (and I bet ehci-hcd does this even for its internal buffers). So what's the point in all this cache handling in ehci-hcd? It's not going to work anyway and just produces problems. So I suggest to just disable all this stuff until generic code will be fixed. Alternatively we can do bounce-buffering inside driver. We should rather introduce generic bounce buffer. But the upper layers are getting fixed recently so we should be getting there. Really? Don't forget my old patch [1] then ;) Still I think we should rip off all the cache stuff from ehci-hcd until all patches for upper layers are included. Again, this stuff doesn't do proper things now anyway and USB won't work with dcache enabled. Have you tested? I enabled dcache on m28 and tried asix ethernet (needed a patch) and loading from ext2 and vfat (worked). So then we have more places that accidentially aligned to 32bytes since this does not work on TI parts which require 64byte alignment. -- Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] bcm: Add GPIO driver for BCM2835 SoC
On 06/27/2012 08:59 PM, Vikram Narayanan wrote: On 6/27/2012 11:36 PM, Stephen Warren wrote: On 06/27/2012 11:32 AM, Vikram Narayanan wrote: ... Do you have a hosted repo somewhere for this rpi_b stuff? If so, please post it here or we shall have one, which has all the patches queued in for the mainline. What do you say? Share your opinions about this. I do have a repo. It's at: https://github.com/swarren/u-boot However, that's my personal work-space. The RPi patches should eventually make it into the official U-Boot repositories through the standard review process. They are: ARM repo: git://git.denx.de/u-boot-arm.git Main repo: git://git.denx.de/u-boot.git I'm aware of this too. I'm referring to a public hosting of these RPi patches somewhere, so that it could easily be submitted to the mainline in _one_ shot. Since your initial SoC support patches aren't added to the u-boot-arm, I planned to have everything queued up for submission into the mainline *via* the mailing list. Hope you got my point. I can certainly apply the GPIO patch to my github tree too if that helps. However, the U-Boot maintainers have indicated that BCM2835 support is too small to warrant their taking patches via git pull rather than mailing list posts. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] i.MX6Q SabreLite: Ethernet does not work at Gigabit speed
On 6/28/2012 8:33 AM, Eric Nelson wrote: On 06/28/2012 06:50 AM, Wolfgang Grandegger wrote: Hi, I just realized that I cannot download files on a Gitabit Ethernet network. I'm getting timeouts: MX6QSABRELITE U-Boot boot Using FEC device TFTP from server 172.16.0.1; our IP address is 172.16.0.100 Filename 'wolf/uImage-mx6q-mainline'. Load address: 0x1080 Loading: error frame: 0x4fd76ca0 0x0804 T error frame: 0x4fd77f00 0x0804 Before I start digging, is this a known issue? Also, I recently posted a patch for mainline u-boot. I'll repost with you and Joe Hershberger in cc. Troy ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 1/1] net: phy: micrel: make ksz9021 phy accessible
Micrel accidentally used the same part number for the KS8721 and KSZ9021. So, both cannot be in the same build of u-boot. Add a config option to handle this. Signed-off-by: Troy Kisky troy.ki...@boundarydevices.com Acked-by: Vladimir Zapolskiy v...@mleia.com --- v2: add ack --- drivers/net/phy/micrel.c| 15 +-- include/configs/mx6qsabrelite.h |1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index e3043df..30f3264 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -35,6 +35,12 @@ static struct phy_driver KSZ804_driver = { .shutdown = genphy_shutdown, }; +#ifndef CONFIG_PHY_MICREL_KSZ9021 +/* + * I can't believe Micrel used the exact same part number + * for the KSZ9021 + * Shame Micrel, Shame! + */ static struct phy_driver KS8721_driver = { .name = Micrel KS8721BL, .uid = 0x221610, @@ -44,7 +50,9 @@ static struct phy_driver KS8721_driver = { .startup = genphy_startup, .shutdown = genphy_shutdown, }; +#endif +#ifdef CONFIG_PHY_MICREL_KSZ9021 /* ksz9021 PHY Registers */ #define MII_KSZ9021_EXTENDED_CTRL 0x0b #define MII_KSZ9021_EXTENDED_DATAW 0x0c @@ -127,12 +135,15 @@ static struct phy_driver ksz9021_driver = { .startup = ksz9021_startup, .shutdown = genphy_shutdown, }; +#endif int phy_micrel_init(void) { phy_register(KSZ804_driver); - phy_register(KS8721_driver); +#ifdef CONFIG_PHY_MICREL_KSZ9021 phy_register(ksz9021_driver); - +#else + phy_register(KS8721_driver); +#endif return 0; } diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h index feabc05..8623320 100644 --- a/include/configs/mx6qsabrelite.h +++ b/include/configs/mx6qsabrelite.h @@ -97,6 +97,7 @@ #define CONFIG_FEC_MXC_PHYADDR 6 #define CONFIG_PHYLIB #define CONFIG_PHY_MICREL +#define CONFIG_PHY_MICREL_KSZ9021 /* USB Configs */ #define CONFIG_CMD_USB -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 0/4] Add support new arch: c6x
On Thu, Jun 28, 2012 at 09:43:57PM +0400, Dmitry Bondar wrote: On Mon, 25/06/2012 at 15:31 -0700, Tom Rini wrote: On Mon, Jun 25, 2012 at 10:02:37PM +0400, Dmitry Bondar wrote: C6X (C6000) is family of fixed and floating-point DSPs manufactured by Texas Instruments. --- Changes for v2: - reset_c.c rewritten with readl/writel. - Tom Rini tr...@ti.com added to cc Changes for v3: - fix coding style - arch/c6x/include/asm/io.h - add memory barriers on readl/writel () Dmitry Bondar (4): Add support new arch: c6x c6x: Add support c674x CPUs c6x: Add suport build davinci SOC with c674x CPUs c6x: Add support c6745-som board I found a good toolchain and gave building the series a whirl, and here's a few things that need fixing: - The davinci symlink isn't safe, running make again results in ln complaining. - The symlink doesn't work in conjunction with separate object directories as it is in the main src tree. - With O= we get arch/arm/cpu/arm926ejs/davinci/libdavinci.o because of the above, which makes link fail. May be i must copy pinmux.c,reset.c,timer.c,cpu.c from arch/arm/arm926ejs/davinci to arch/c6x/c674x/c674x, remove from them all not used ifdef (#ifdef CONFIG_SOC_DM355) and don't set in boards.cfg SOC for board? This allow don't use symlink. No, I think you just need to rework the mkconfig logic you're adding. It should be, roughly, outside of the ! -z ${soc} check: If c6x and davinci rm -f arch/c6x/cpu/c674x/davinci rm -f asm/arch if srctree != objtree set symlinks one way else set symlinks another way fi fi Then once that works, see if you can shrink the logic down to just set a prefix variable or two and always set the symlinks. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/8] EXT2: Indent cleanup ext2fs.c
On Fri, Jun 08, 2012 at 07:31:47PM +0200, Marek Vasut wrote: * Mostly cleanup problems reported by checkpatch.pl -f * Minor tweaks where it simplified the code Signed-off-by: Marek Vasut ma...@denx.de Cc: Wolfgang Denk w...@denx.de --- fs/ext2/ext2fs.c | 264 ++ 1 file changed, 128 insertions(+), 136 deletions(-) diff --git a/fs/ext2/ext2fs.c b/fs/ext2/ext2fs.c index a4f3094..f9e9228 100644 --- a/fs/ext2/ext2fs.c +++ b/fs/ext2/ext2fs.c @@ -27,12 +27,11 @@ #include ext2fs.h #include ext_common.h #include malloc.h -#include asm/byteorder.h +#include linux/byteorder/generic.h -extern int ext2fs_devread (int sector, int byte_offset, int byte_len, +extern int ext2fs_devread(int sector, int byte_offset, int byte_len, char *buf); - This is not applying to origin/master. It has: /* Magic value used to identify an ext2 filesystem. */ #define EXT2_MAGIC 0xEF53 /* Amount of indirect blocks in an inode. */ #define INDIRECT_BLOCKS 12 /* Maximum lenght of a pathname. */ #define EXT2_PATH_MAX 4096 /* Maximum nesting of symlinks, used to prevent a loop. */ #define EXT2_MAX_SYMLINKCNT 8 at line 33, 32 after. a git blame for these lines shows only 2b918712 which is from 2004. What is this based on? a4f3094 isn't in my tree... thx, Jason. struct ext2_data *ext2fs_root = NULL; struct ext2fs_node *ext2fs_file; int symlinknest = 0; @@ -65,55 +64,55 @@ static int ext2fs_blockgroup } - -static int ext2fs_read_inode - (struct ext2_data *data, int ino, struct ext2_inode *inode) { +static int ext2fs_read_inode(struct ext2_data *data, int ino, + struct ext2_inode *inode) +{ struct ext2_block_group blkgrp; struct ext2_sblock *sblock = data-sblock; - int inodes_per_block; - int status; - unsigned int blkno; unsigned int blkoff; + int status; + int inodes_per_block; -#ifdef DEBUG - printf (ext2fs read inode %d, inode_size %d\n, ino, inode_size); -#endif - /* It is easier to calculate if the first inode is 0. */ + debug(EXT2: read inode %d, inode_size %d\n, ino, inode_size); + + /* It is easier to calculate if the first inode is 0. */ ino--; - status = ext2fs_blockgroup (data, ino / __le32_to_cpu - (sblock-inodes_per_group), blkgrp); - if (status == 0) { - return (0); - } + status = ext2fs_blockgroup(data, + ino / __le32_to_cpu(sblock-inodes_per_group), + blkgrp); + if (status == 0) + return 0; inodes_per_block = EXT2_BLOCK_SIZE(data) / inode_size; - blkno = __le32_to_cpu (blkgrp.inode_table_id) + - (ino % __le32_to_cpu (sblock-inodes_per_group)) - / inodes_per_block; + blkno = __le32_to_cpu(blkgrp.inode_table_id) + + (ino % __le32_to_cpu(sblock-inodes_per_group)) / + inodes_per_block; blkoff = (ino % inodes_per_block) * inode_size; -#ifdef DEBUG - printf (ext2fs read inode blkno %d blkoff %d\n, blkno, blkoff); -#endif - /* Read the inode. */ - status = ext2fs_devread (blkno LOG2_EXT2_BLOCK_SIZE (data), blkoff, + + debug(EXT2: read inode blkno %d blkoff %d\n, blkno, blkoff); + + /* Read the inode. */ + status = ext2fs_devread(blkno LOG2_EXT2_BLOCK_SIZE (data), blkoff, sizeof (struct ext2_inode), (char *) inode); - if (status == 0) { - return (0); - } + if (status == 0) + return 0; - return (1); + return 1; } - -void ext2fs_free_node(struct ext2fs_node *node, struct ext2fs_node *currroot) +static void ext2fs_free_node(struct ext2fs_node *node, + struct ext2fs_node *currroot) { - if ((node != ext2fs_root-diropen) (node != currroot)) { - free (node); - } -} + if (node == ext2fs_root-diropen) + return; + + if (node == currroot) + return; + free(node); +} static int ext2fs_read_block(struct ext2fs_node *node, int fileblock) { @@ -490,7 +489,6 @@ static char *ext2fs_read_symlink(struct ext2fs_node *node) return (symlink); } - int ext2fs_find_file1 (const char *currpath, struct ext2fs_node *currroot, struct ext2fs_node **currfound, int *foundtype) @@ -595,172 +593,166 @@ int ext2fs_find_file1 return (-1); } - -int ext2fs_find_file - (const char *path, struct ext2fs_node *rootnode, - struct ext2fs_node **foundnode, int expecttype) +static int ext2fs_find_file(const char *path, struct ext2fs_node *rootnode, + struct ext2fs_node **foundnode, int expecttype) { int status; int foundtype =
[U-Boot] [PATCH v2 0/1] fsl_elbc support for 4k devices and factory badblock migration
This is my implementation of the factory badblock migration process for the fsl_elbc driver using the hack to support nand devices with page sizes bigger than 2048k. The migrated pattern is in test mode. I really don't know what is the convention for something like this, and would like to hear suggestions of what this pattern should be. I would really appreciate any feedback related to the patch. Changes in v2: - Added check to disallow the migration code to run in devices with page size = 2048 Rafael Beims (1): nand: Hack to support 4k page in fsl_elbc_nand drivers/mtd/nand/fsl_elbc_nand.c | 447 +++--- 1 files changed, 419 insertions(+), 28 deletions(-) ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] nand: Hack to support 4k page in fsl_elbc_nand
Freescale FCM controller has a 2K size limitation of buffer RAM. In order to support the Nand flash chip with pagesize larger than 2K bytes, we read/write 2k data repeatedly by issuing FIR_OP_RB/FIR_OP_WB and save them to a large buffer. Because of this, the in flash layout of the oob is different from the default for 4096kiB page sizes. Therefore, we need to migrate the factory bad block markers from the original position to the new layout. Signed-off-by: Shengzhou Liu shengzhou@freescale.com Signed-off-by: Liu Shuo b35...@freescale.com Signed-off-by: Rafael Beims rafael.be...@datacom.ind.br --- Changes in v2: - Added check to disallow the migration code to run in devices with page size = 2048 drivers/mtd/nand/fsl_elbc_nand.c | 447 +++--- 1 files changed, 419 insertions(+), 28 deletions(-) diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index 9076ad4..3b6bb1d 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c @@ -76,15 +76,17 @@ struct fsl_elbc_ctrl { /* device info */ fsl_lbc_t *regs; - u8 __iomem *addr;/* Address of assigned FCM buffer*/ - unsigned int page; /* Last page written to / read from */ - unsigned int read_bytes; /* Number of bytes read during command */ - unsigned int column; /* Saved column from SEQIN */ - unsigned int index; /* Pointer to next byte to 'read'*/ - unsigned int status; /* status read from LTESR after last op */ - unsigned int mdr;/* UPM/FCM Data Register value */ - unsigned int use_mdr;/* Non zero if the MDR is to be set */ - unsigned int oob;/* Non zero if operating on OOB data */ + u8 __iomem *addr; /* Address of assigned FCM buffer */ + unsigned int page; /* Last page written to / read from */ + unsigned int read_bytes;/* Number of bytes read during command */ + unsigned int column;/* Saved column from SEQIN */ + unsigned int index; /* Pointer to next byte to 'read' */ + unsigned int status;/* status read from LTESR after last op */ + unsigned int mdr; /* UPM/FCM Data Register value */ + unsigned int use_mdr; /* Non zero if the MDR is to be set */ + unsigned int oob; /* Non zero if operating on OOB data*/ + char *buffer; /* Just used when pagesize is greater */ + /* than FCM RAM 2K limitation */ }; /* These map to the positions used by the FCM hardware ECC generator */ @@ -131,6 +133,15 @@ static struct nand_bbt_descr largepage_memorybased = { .pattern = scan_ff_pattern, }; +static u8 migrated_pattern[] = { 0xde, 0xad, 0xde, 0xad }; +static struct nand_bbt_descr largepage_migrated = { + .options = 0, + .offs = 1, + .len = 4, + .maxblocks = 3, + .pattern = migrated_pattern, +}; + /* * ELBC may use HW ECC, so that OOB offsets, that NAND core uses for bbt, * interfere with ECC positions, that's why we implement our own descriptors. @@ -159,6 +170,35 @@ static struct nand_bbt_descr bbt_mirror_descr = { .pattern = mirror_pattern, }; +static void io_to_buffer(struct mtd_info *mtd, int subpage, int oob) +{ + struct nand_chip *chip = mtd-priv; + struct fsl_elbc_mtd *priv = chip-priv; + struct fsl_elbc_ctrl *ctrl = priv-ctrl; + void *src, *dst; + int len = oob ? 64 : 2048; + + /* for emulating 4096+ bytes NAND using 2048-byte FCM RAM */ + dst = ctrl-buffer + (oob ? mtd-writesize : 0) + subpage * len; + src = ctrl-addr + (oob ? 2048 : 0); + memcpy_fromio(dst, src, len); +} + +static void buffer_to_io(struct mtd_info *mtd, int subpage, int oob) +{ + struct nand_chip *chip = mtd-priv; + struct fsl_elbc_mtd *priv = chip-priv; + struct fsl_elbc_ctrl *ctrl = priv-ctrl; + void *src, *dst; + int len = oob ? 64 : 2048; + + src = ctrl-buffer + (oob ? mtd-writesize : 0) + subpage * len; + dst = ctrl-addr + (oob ? 2048 : 0); + memcpy_toio(dst, src, len); + /* See the in_8() in fsl_elbc_write_buf() */ + in_8(ctrl-addr); +} + /*=*/ /* @@ -194,7 +234,7 @@ static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob) /* for OOB data point to the second half of the buffer */ if (oob) - ctrl-index += priv-page_size ? 2048 : 512; + ctrl-index += mtd-writesize; vdbg(set_addr: bank=%d, ctrl-addr=0x%p (0x%p), index %x, pes %d ps %d\n, @@ -256,13 +296,14 @@ static int fsl_elbc_run_command(struct mtd_info *mtd) return ctrl-status == LTESR_CC ? 0 : -EIO; } -static void fsl_elbc_do_read(struct
[U-Boot] [PATCH 1/5] [PATCH 1/5] Add missing constant to mx27
Signed-off-by: Philippe Reynes trem...@yahoo.fr Signed-off-by: Eric Jarrige eric.jarr...@armadeus.org --- arch/arm/cpu/arm926ejs/mx27/asm-offsets.c | 34 arch/arm/include/asm/arch-mx27/imx-regs.h | 11 - arch/arm/include/asm/arch-mx27/mxc_nand.h | 83 + 3 files changed, 127 insertions(+), 1 deletions(-) create mode 100644 arch/arm/include/asm/arch-mx27/mxc_nand.h diff --git a/arch/arm/cpu/arm926ejs/mx27/asm-offsets.c b/arch/arm/cpu/arm926ejs/mx27/asm-offsets.c index f3a8d7b..b95c58c 100644 --- a/arch/arm/cpu/arm926ejs/mx27/asm-offsets.c +++ b/arch/arm/cpu/arm926ejs/mx27/asm-offsets.c @@ -34,6 +34,7 @@ int main(void) DEFINE(PCDR1, IMX_PLL_BASE + offsetof(struct pll_regs, pcdr1)); DEFINE(PCCR0, IMX_PLL_BASE + offsetof(struct pll_regs, pccr0)); DEFINE(PCCR1, IMX_PLL_BASE + offsetof(struct pll_regs, pccr1)); + DEFINE(CCSR, IMX_PLL_BASE + offsetof(struct pll_regs, ccsr)); DEFINE(ESDCTL0_ROF, offsetof(struct esdramc_regs, esdctl0)); DEFINE(ESDCFG0_ROF, offsetof(struct esdramc_regs, esdcfg0)); @@ -41,5 +42,38 @@ int main(void) DEFINE(ESDCFG1_ROF, offsetof(struct esdramc_regs, esdcfg1)); DEFINE(ESDMISC_ROF, offsetof(struct esdramc_regs, esdmisc)); + DEFINE(GPCR, IMX_SYSTEM_CTL_BASE + + offsetof(struct system_control_regs, gpcr)); + DEFINE(FMCR, IMX_SYSTEM_CTL_BASE + + offsetof(struct system_control_regs, fmcr)); + DEFINE(DSCR2, IMX_SYSTEM_CTL_BASE + + offsetof(struct system_control_regs, dscr2)); + DEFINE(DSCR3, IMX_SYSTEM_CTL_BASE + + offsetof(struct system_control_regs, dscr3)); + DEFINE(DSCR7, IMX_SYSTEM_CTL_BASE + + offsetof(struct system_control_regs, dscr7)); + DEFINE(DSCR10, IMX_SYSTEM_CTL_BASE + + offsetof(struct system_control_regs, dscr10)); + + DEFINE(CS0U, IMX_WEIM_BASE + offsetof(struct weim_regs, cs0u)); + DEFINE(CS0L, IMX_WEIM_BASE + offsetof(struct weim_regs, cs0l)); + DEFINE(CS0A, IMX_WEIM_BASE + offsetof(struct weim_regs, cs0a)); + DEFINE(CS1U, IMX_WEIM_BASE + offsetof(struct weim_regs, cs1u)); + DEFINE(CS1L, IMX_WEIM_BASE + offsetof(struct weim_regs, cs1l)); + DEFINE(CS1A, IMX_WEIM_BASE + offsetof(struct weim_regs, cs1a)); + DEFINE(CS2U, IMX_WEIM_BASE + offsetof(struct weim_regs, cs2u)); + DEFINE(CS2L, IMX_WEIM_BASE + offsetof(struct weim_regs, cs2l)); + DEFINE(CS2A, IMX_WEIM_BASE + offsetof(struct weim_regs, cs2a)); + DEFINE(CS3U, IMX_WEIM_BASE + offsetof(struct weim_regs, cs3u)); + DEFINE(CS3L, IMX_WEIM_BASE + offsetof(struct weim_regs, cs3l)); + DEFINE(CS3A, IMX_WEIM_BASE + offsetof(struct weim_regs, cs3a)); + DEFINE(CS4U, IMX_WEIM_BASE + offsetof(struct weim_regs, cs4u)); + DEFINE(CS4L, IMX_WEIM_BASE + offsetof(struct weim_regs, cs4l)); + DEFINE(CS4A, IMX_WEIM_BASE + offsetof(struct weim_regs, cs4a)); + DEFINE(CS5U, IMX_WEIM_BASE + offsetof(struct weim_regs, cs5u)); + DEFINE(CS5L, IMX_WEIM_BASE + offsetof(struct weim_regs, cs5l)); + DEFINE(CS5A, IMX_WEIM_BASE + offsetof(struct weim_regs, cs5a)); + DEFINE(EIM, IMX_WEIM_BASE + offsetof(struct weim_regs, eim)); + return 0; } diff --git a/arch/arm/include/asm/arch-mx27/imx-regs.h b/arch/arm/include/asm/arch-mx27/imx-regs.h index ced5b2a..fe2861e 100644 --- a/arch/arm/include/asm/arch-mx27/imx-regs.h +++ b/arch/arm/include/asm/arch-mx27/imx-regs.h @@ -206,7 +206,7 @@ struct iim_regs { struct fuse_bank { u32 fuse_regs[0x20]; u32 fuse_rsvd[0xe0]; - } bank[1]; + } bank[2]; }; struct fuse_bank0_regs { @@ -522,4 +522,13 @@ struct fuse_bank0_regs { #define IIM_ERR_SNSE (1 2) #define IIM_ERR_PARITYE(1 1) +/* + * Memory areas of the NFC + */ +#define IMX_NFC_BASE(0xD800) +#define IMX_NFC_MAIN_AREA0 (0xD800) +#define IMX_NFC_MAIN_AREA1 (0xD8000200) +#define IMX_NFC_SPARE_AREA0 (0xD8000800) +#define IMX_NFC_REGS(0xD8000E00) + #endif /* _IMX_REGS_H */ diff --git a/arch/arm/include/asm/arch-mx27/mxc_nand.h b/arch/arm/include/asm/arch-mx27/mxc_nand.h new file mode 100644 index 000..3429601 --- /dev/null +++ b/arch/arm/include/asm/arch-mx27/mxc_nand.h @@ -0,0 +1,83 @@ +/* + * (c) 2012 Philippe Reynes trem...@yahoo.fr + * + * 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
[U-Boot] [PATCH 2/5] [PATCH 2/5] Add support for the armadeus APF27 board
Signed-off-by: Philippe Reynes trem...@yahoo.fr Signed-off-by: Eric Jarrige eric.jarr...@armadeus.org Signed-off-by: Nicolas Colombain nicolas.colomb...@armadeus.com --- board/armadeus/apf27/Makefile| 52 ++ board/armadeus/apf27/apf27.c | 310 ++ board/armadeus/apf27/config.mk | 38 board/armadeus/apf27/lowlevel_init.S | 275 ++ boards.cfg |1 + 5 files changed, 676 insertions(+), 0 deletions(-) create mode 100644 board/armadeus/apf27/Makefile create mode 100644 board/armadeus/apf27/apf27.c create mode 100644 board/armadeus/apf27/config.mk create mode 100644 board/armadeus/apf27/lowlevel_init.S diff --git a/board/armadeus/apf27/Makefile b/board/armadeus/apf27/Makefile new file mode 100644 index 000..fe6ba5c --- /dev/null +++ b/board/armadeus/apf27/Makefile @@ -0,0 +1,52 @@ +# +# (C) Copyright 2000-2004 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# (C) Copyright 2012 +# Eric Jarrige eric.jarr...@armadeus.org +# +# 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).o + +COBJS := apf27.o +SOBJS := lowlevel_init.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak $(obj).depend + +# + +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/armadeus/apf27/apf27.c b/board/armadeus/apf27/apf27.c new file mode 100644 index 000..75be2c1 --- /dev/null +++ b/board/armadeus/apf27/apf27.c @@ -0,0 +1,310 @@ +/* + * Copyright (C) 2007 Sascha Hauer, Pengutronix + * Copyright (C) 2008-2012 Eric Jarrige eric.jarr...@armadeus.org + * + * 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 common.h +#include crc.h +#include jffs2/jffs2.h +#include nand.h +#include netdev.h +#include asm/io.h +#include asm/arch/imx-regs.h +#include asm/errno.h + +DECLARE_GLOBAL_DATA_PTR; + +u32 get_board_rev(void) +{ + struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE; + + return readl(iim-bank[1].fuse_regs[8]); +} + +int get_num_ram_bank(void) +{ + struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE; + int nr_dram_banks = 1; + + if ((get_board_rev() 0) (CONFIG_NR_DRAM_BANKS 1)) + nr_dram_banks += readl(iim-bank[1].fuse_regs[9]) 0x01; + else + nr_dram_banks = CONFIG_NR_DRAM_POPULATED; + + return nr_dram_banks; +} + +static void apf27_gpio_init(void) +{ + struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE; + + /* PORT A */ + writel(CONFIG_SYS_DR_A_VAL,regs-port[PORTA].dr); + writel(CONFIG_SYS_OCR1_A_VAL, regs-port[PORTA].ocr1); + writel(CONFIG_SYS_OCR2_A_VAL, regs-port[PORTA].ocr2); + writel(CONFIG_SYS_ICFA1_A_VAL, regs-port[PORTA].iconfa1); + writel(CONFIG_SYS_ICFA2_A_VAL, regs-port[PORTA].iconfa2); + writel(CONFIG_SYS_ICFB1_A_VAL, regs-port[PORTA].iconfb1); + writel(CONFIG_SYS_ICFB2_A_VAL, regs-port[PORTA].iconfb2); + writel(CONFIG_SYS_ICR1_A_VAL, regs-port[PORTA].icr1); + writel(CONFIG_SYS_ICR2_A_VAL, regs-port[PORTA].icr2); +
[U-Boot] [PATCH 3/5] [PATCH 3/5] Add nand_spl support for the apf27
Signed-off-by: Philippe Reynes trem...@yahoo.fr Signed-off-by: Eric Jarrige eric.jarr...@armadeus.org --- nand_spl/board/armadeus/apf27/Makefile | 79 + nand_spl/board/armadeus/apf27/config.mk | 45 +++ nand_spl/board/armadeus/apf27/start.S| 548 ++ nand_spl/board/armadeus/apf27/u-boot.lds | 39 +++ 4 files changed, 711 insertions(+), 0 deletions(-) create mode 100644 nand_spl/board/armadeus/apf27/Makefile create mode 100644 nand_spl/board/armadeus/apf27/config.mk create mode 100644 nand_spl/board/armadeus/apf27/start.S create mode 100644 nand_spl/board/armadeus/apf27/u-boot.lds diff --git a/nand_spl/board/armadeus/apf27/Makefile b/nand_spl/board/armadeus/apf27/Makefile new file mode 100644 index 000..600ef6b --- /dev/null +++ b/nand_spl/board/armadeus/apf27/Makefile @@ -0,0 +1,79 @@ +# +# (C) Copyright 2007 +# Stefan Roese, DENX Software Engineering, s...@denx.de. +# (C) Copyright 2012 +# Eric Jarrige eric.jarr...@armadeus.org +# +# 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 +include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk + +LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds +LDFLAGS= -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS) +AFLAGS += -DCONFIG_NAND_SPL +CFLAGS += -DCONFIG_NAND_SPL + +SOBJS = start.o +COBJS = + +SRCS := $(addprefix $(src),$(SOBJS:.o=.S) $(COBJS:.o=.c)) +OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) +__OBJS := $(SOBJS) $(COBJS) +LNDIR := $(OBJTREE)/nand_spl/board/$(BOARDDIR) + +nandobj:= $(OBJTREE)/nand_spl/ + +ALL= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin \ + $(nandobj)System.map + +all: $(obj).depend $(ALL) + +$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl + $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $ $@ + +$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl + $(OBJCOPY) ${OBJCFLAGS} -O binary $ $@ + +$(nandobj)u-boot-spl: $(OBJS) + cd $(LNDIR) $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \ + -Map $(nandobj)u-boot-spl.map \ + -o $(nandobj)u-boot-spl + +$(nandobj)System.map: $(nandobj)u-boot-spl + @$(NM) $ | \ + grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ + sort $(nandobj)System.map + + +# + +$(obj)%.o: %.S + $(CC) $(AFLAGS) -c -o $@ $ + +$(obj)%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $ + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/nand_spl/board/armadeus/apf27/config.mk b/nand_spl/board/armadeus/apf27/config.mk new file mode 100644 index 000..3063c89 --- /dev/null +++ b/nand_spl/board/armadeus/apf27/config.mk @@ -0,0 +1,45 @@ +# +# (C) Copyright 2007 +# Stefan Roese, DENX Software Engineering, s...@denx.de. +# (C) Copyright 2012 +# Eric Jarrige eric.jarr...@armadeus.org +# +# 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 +# +# +# This config file is used for compilation of armadeus apf27 board +# + +# +# TEXT_BASE for SPL: +# +# +# This config file is used for compilation of armadeus sources +# +# You might change location of U-Boot in memory by setting right TEXT_BASE. +# This allows for example having one copy located at the end of ram and stored +# in flash device and
[U-Boot] [PATCH 4/5] [PATCH 4/5] Add FPGA support for the apf27 board
Signed-off-by: Philippe Reynes trem...@yahoo.fr Signed-off-by: Eric Jarrige eric.jarr...@armadeus.org --- board/armadeus/apf27/Makefile |2 +- board/armadeus/apf27/apf27.c | 16 +++ board/armadeus/apf27/fpga.c | 272 + board/armadeus/apf27/fpga.h | 39 ++ 4 files changed, 328 insertions(+), 1 deletions(-) create mode 100644 board/armadeus/apf27/fpga.c create mode 100644 board/armadeus/apf27/fpga.h diff --git a/board/armadeus/apf27/Makefile b/board/armadeus/apf27/Makefile index fe6ba5c..7a39426 100644 --- a/board/armadeus/apf27/Makefile +++ b/board/armadeus/apf27/Makefile @@ -27,7 +27,7 @@ include $(TOPDIR)/config.mk LIB= $(obj)lib$(BOARD).o -COBJS := apf27.o +COBJS := apf27.o fpga.o SOBJS := lowlevel_init.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) diff --git a/board/armadeus/apf27/apf27.c b/board/armadeus/apf27/apf27.c index 75be2c1..b073703 100644 --- a/board/armadeus/apf27/apf27.c +++ b/board/armadeus/apf27/apf27.c @@ -21,6 +21,7 @@ #include common.h #include crc.h +#include fpga.h #include jffs2/jffs2.h #include nand.h #include netdev.h @@ -241,6 +242,21 @@ misc_init_r(void) struct mtd_device *dev; struct part_info *part; +#if defined(CONFIG_FPGA) + /* init and download fpga */ + if ((autoload) (0 == strcmp(autoload, 1))) { + if (mtdparts_init() == 0) + if (find_dev_and_part(firmware, + dev, pnum, part) == 0) { + size = part-size; + if (nand_read_skip_bad(nand_info[0], + part-offset, size, firmware_buffer)) + size = 0; + } + } + APF27_init_fpga(firmware_buffer, size); +#endif + /* detect compatibility issue of environment version */ s = getenv(env_version); if ((NULL == s) || (0 != strcmp(s, CONFIG_ENV_VERSION))) { diff --git a/board/armadeus/apf27/fpga.c b/board/armadeus/apf27/fpga.c new file mode 100644 index 000..9a9e8da --- /dev/null +++ b/board/armadeus/apf27/fpga.c @@ -0,0 +1,272 @@ +/* + * (C) Copyright 2002-2012 + * Eric Jarrige eric.jarr...@armadeus.org + * Rich Ireland, Enterasys Networks, rirel...@enterasys.com. + * Keith Outwater, keith_outwa...@mvis.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 common.h + +#if defined(CONFIG_FPGA) + +#include asm/arch/imx-regs.h +#include asm/io.h +#include command.h +#include config.h +#include fpga.h +#include spartan3.h + +#define GPIO_PORT(x) ((x GPIO_PORT_MASK) GPIO_PORT_SHIFT) +#define GPIO_SET(x) writel(readl(gpregs-port[GPIO_PORT(x)].dr) | \ + (1 (x GPIO_PIN_MASK)), gpregs-port[GPIO_PORT(x)].dr) + +/* (DR(GPIO_PORT(x)) |= (1(x GPIO_PIN_MASK))) */ +#define GPIO_CLEAR(x) writel(readl(gpregs-port[GPIO_PORT(x)].dr) \ + ~(1 (x GPIO_PIN_MASK)), gpregs-port[GPIO_PORT(x)].dr) +/* (DR(GPIO_PORT(x)) = ~(1(x GPIO_PIN_MASK))) */ +#define GPIO_WRITE(x, y) (y ? GPIO_SET(x) : GPIO_CLEAR(x)) +#define GPIO_READ(x) ((readl(gpregs-port[GPIO_PORT(x)].ssr) \ + (1 (x GPIO_PIN_MASK))) (x GPIO_PIN_MASK)) +/* ((SSR (GPIO_PORT(x)) (1(x GPIO_PIN_MASK))) (x GPIO_PIN_MASK)) */ +#ifdef FPGA_DEBUG +#definePRINTF(fmt, args...)printf(fmt, ##args) +#else +#definePRINTF(fmt, args...) +#endif + +/* Note that these are pointers to code that is in Flash. They will be + * relocated at runtime. + * Spartan2 code is used to download our Spartan 3 :) code is compatible. + * Just take care about the file size +*/ +Xilinx_Spartan3_Slave_Parallel_fns fpga_fns = { + fpga_pre_fn, + fpga_pgm_fn, + fpga_init_fn, + NULL, + fpga_done_fn, + fpga_clk_fn, + fpga_cs_fn, + fpga_wr_fn, + fpga_rdata_fn, + fpga_wdata_fn, + fpga_busy_fn, + fpga_abort_fn, + fpga_post_fn, +}; + +Xilinx_desc fpga[CONFIG_FPGA_COUNT] = { + {Xilinx_Spartan3, +slave_parallel, +1196128l/8, +(void *) fpga_fns, +0} +}; + +/* + * nitialize GPIO port B before download + */ +int
[U-Boot] [PATCH 5/5] [PATCH 5/5] Add config file for the apf27
Signed-off-by: Philippe Reynes trem...@yahoo.fr --- include/configs/apf27.h | 916 +++ 1 files changed, 916 insertions(+), 0 deletions(-) create mode 100644 include/configs/apf27.h diff --git a/include/configs/apf27.h b/include/configs/apf27.h new file mode 100644 index 000..985fa1a --- /dev/null +++ b/include/configs/apf27.h @@ -0,0 +1,916 @@ +/* + * + * Configuration settings for the Armadeus Project motherboard APF27 + * + * Copyright (C) 2008-2012 ej / Armadeus Project eric.jarr...@armadeus.org + * + * 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 __CONFIG_H +#define __CONFIG_H + +#define CONFIG_VERSION_VARIABLE +#define CONFIG_ENV_VERSION 3.1 +#define CONFIG_IDENT_STRING apf27 patch 3.6 +#define CONFIG_BOARD_NAME apf27 + +/* + * SoC configurations + */ +#define CONFIG_ARM926EJS /* this is an ARM926EJS CPU */ +#define CONFIG_MX27/* in a Freescale i.MX27 Chip */ +#define CONFIG_MACH_TYPE 1698/* APF27 */ + +/* + * Enable the call to miscellaneous platform dependent initialization. + */ +#define CONFIG_SYS_NO_FLASH/* to be define before config_cmd_default.h */ +#define CONFIG_SYS_DCACHE_OFF +#define CONFIG_MISC_INIT_R + +/* + * Board display option + */ +#define CONFIG_DISPLAY_BOARDINFO +#define CONFIG_DISPLAY_CPUINFO + +/* + * SPL + */ +#define CONFIG_NAND_U_BOOT +/* Copy SPL+U-Boot here */ +#define CONFIG_SYS_NAND_U_BOOT_DST CONFIG_SYS_LOAD_ADDR +/* Size is the partion size */ +#define CONFIG_SYS_NAND_U_BOOT_SIZECONFIG_SYS_MONITOR_LEN + +/* + * BOOTP options + */ +#define CONFIG_BOOTP_SUBNETMASK +#define CONFIG_BOOTP_GATEWAY +#define CONFIG_BOOTP_HOSTNAME +#define CONFIG_BOOTP_BOOTPATH +#define CONFIG_BOOTP_BOOTFILESIZE +#define CONFIG_BOOTP_DNS +#define CONFIG_BOOTP_DNS2 + +#define CONFIG_HOSTNAMECONFIG_BOARD_NAME +#define CONFIG_ROOTPATH/tftpboot/ MK_STR(CONFIG_BOARD_NAME) -root + +/* + * U-Boot Commands + */ +#include config_cmd_default.h + +#define CONFIG_CMD_ASKENV /* ask for env variable */ +#define CONFIG_CMD_BSP /* Board Specific functions */ +#define CONFIG_CMD_CACHE /* icache, dcache */ +/*#define CONFIG_CMD_DATE */ /* support for RTC, date/time...*/ +#define CONFIG_CMD_DHCP/* DHCP Support */ +#define CONFIG_CMD_DNS +/*#define CONFIG_CMD_EEPROM */ /* EEPROM read/write support*/ +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_FAT /* FAT support */ +/*#define CONFIG_CMD_I2C *//* I2C serial bus support */ +#define CONFIG_CMD_IMX_FUSE/* imx iim fuse */ +#define CONFIG_CMD_MII /* MII support */ +#define CONFIG_CMD_MMC +#define CONFIG_CMD_MTDPARTS/* MTD partition support*/ +#define CONFIG_CMD_NAND/* NAND support */ +#define CONFIG_CMD_NAND_LOCK_UNLOCK +#define CONFIG_CMD_NAND_TRIMFFS +#define CONFIG_CMD_NFS /* NFS support */ +#define CONFIG_CMD_PING/* ping support */ +#define CONFIG_CMD_SETEXPR /* setexpr support */ +#define CONFIG_CMD_UBI +#define CONFIG_CMD_UBIFS + +/* + * Memory configurations + */ +#define CONFIG_NR_DRAM_POPULATED 1 +#define CONFIG_NR_DRAM_BANKS 2 + +#define CONFIG_SYS_SDRAM_MBYTE_SYZE 64 + +#define PHYS_SDRAM_1 0xA000 +#define PHYS_SDRAM_2 0xB000 +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (51210)) +#define CONFIG_SYS_GBL_DATA_SIZE 256 /* Initial data */ +#define CONFIG_SYS_MEMTEST_START 0xA000 /* memtest test area */ +#define CONFIG_SYS_MEMTEST_END 0xA030 /* 3 MiB RAM test */ + +#define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_SDRAM_BASE \ + + PHYS_SDRAM_1_SIZE - 0x010) + +#define CONFIG_SYS_TEXT_BASE 0xA100 + +/* + * FLASH organization + */ +/*#define CONFIG_SYS_MONITOR_BASE 0xAFF0*/ +#defineCONFIG_SYS_MONITOR_OFFSET 0x +#defineCONFIG_SYS_MONITOR_LEN 0x0010 /* 1MiB */ +#define CONFIG_ENV_IS_IN_NAND +#define
Re: [U-Boot] [PATCH v4 3/6] mcx: Disable DCACHE since USB EHCI is enabled
Dear Tom Rini, On 06/28/2012 07:37 AM, Marek Vasut wrote: Dear Ilya Yanok, Dear Marek, 28.06.2012 02:48, Marek Vasut wrote: Sorry for missing this discussion. I think compile-time disabling of the cache is too brutal. ehci-hcd cache handling is broken anyway: doing unaligned flushes/invalidates is a bug, and we know for sure that upper layers don't care about alignment (and I bet ehci-hcd does this even for its internal buffers). So what's the point in all this cache handling in ehci-hcd? It's not going to work anyway and just produces problems. So I suggest to just disable all this stuff until generic code will be fixed. Alternatively we can do bounce-buffering inside driver. We should rather introduce generic bounce buffer. But the upper layers are getting fixed recently so we should be getting there. Really? Don't forget my old patch [1] then ;) Still I think we should rip off all the cache stuff from ehci-hcd until all patches for upper layers are included. Again, this stuff doesn't do proper things now anyway and USB won't work with dcache enabled. Have you tested? I enabled dcache on m28 and tried asix ethernet (needed a patch) and loading from ext2 and vfat (worked). So then we have more places that accidentially aligned to 32bytes since this does not work on TI parts which require 64byte alignment. Oh, this is very good it's broken. People actually started whining. Now we have to wait until they start identifying the problematic places and fixing them. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/8] EXT2: Indent cleanup ext2fs.c
Dear Jason Cooper, On Fri, Jun 08, 2012 at 07:31:47PM +0200, Marek Vasut wrote: * Mostly cleanup problems reported by checkpatch.pl -f * Minor tweaks where it simplified the code Signed-off-by: Marek Vasut ma...@denx.de Cc: Wolfgang Denk w...@denx.de --- fs/ext2/ext2fs.c | 264 ++ 1 file changed, 128 insertions(+), 136 deletions(-) diff --git a/fs/ext2/ext2fs.c b/fs/ext2/ext2fs.c index a4f3094..f9e9228 100644 --- a/fs/ext2/ext2fs.c +++ b/fs/ext2/ext2fs.c @@ -27,12 +27,11 @@ #include ext2fs.h #include ext_common.h #include malloc.h -#include asm/byteorder.h +#include linux/byteorder/generic.h -extern int ext2fs_devread (int sector, int byte_offset, int byte_len, +extern int ext2fs_devread(int sector, int byte_offset, int byte_len, char *buf); - This is not applying to origin/master. It has: /* Magic value used to identify an ext2 filesystem. */ #define EXT2_MAGIC 0xEF53 /* Amount of indirect blocks in an inode. */ #define INDIRECT_BLOCKS 12 /* Maximum lenght of a pathname. */ #define EXT2_PATH_MAX 4096 /* Maximum nesting of symlinks, used to prevent a loop. */ #define EXT2_MAX_SYMLINKCNT 8 at line 33, 32 after. a git blame for these lines shows only 2b918712 which is from 2004. What is this based on? a4f3094 isn't in my tree... thx, Ok, I'll go through it and let you know soon. I hope about next week. Do you might hacking on something else in the meantime, don't waste your time here please until I look through it. Jason. [...] ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 3/6] mcx: Disable DCACHE since USB EHCI is enabled
Dear Tom Rini, On Fri, Jun 29, 2012 at 12:01:58AM +0200, Marek Vasut wrote: Dear Tom Rini, On 06/28/2012 07:37 AM, Marek Vasut wrote: Dear Ilya Yanok, Dear Marek, 28.06.2012 02:48, Marek Vasut wrote: Sorry for missing this discussion. I think compile-time disabling of the cache is too brutal. ehci-hcd cache handling is broken anyway: doing unaligned flushes/invalidates is a bug, and we know for sure that upper layers don't care about alignment (and I bet ehci-hcd does this even for its internal buffers). So what's the point in all this cache handling in ehci-hcd? It's not going to work anyway and just produces problems. So I suggest to just disable all this stuff until generic code will be fixed. Alternatively we can do bounce-buffering inside driver. We should rather introduce generic bounce buffer. But the upper layers are getting fixed recently so we should be getting there. Really? Don't forget my old patch [1] then ;) Still I think we should rip off all the cache stuff from ehci-hcd until all patches for upper layers are included. Again, this stuff doesn't do proper things now anyway and USB won't work with dcache enabled. Have you tested? I enabled dcache on m28 and tried asix ethernet (needed a patch) and loading from ext2 and vfat (worked). So then we have more places that accidentially aligned to 32bytes since this does not work on TI parts which require 64byte alignment. Oh, this is very good it's broken. People actually started whining. Now we have to wait until they start identifying the problematic places and fixing them. Uh-hunh. So I guess for v2012.07 we'll build-time disable dcache for beagle and omap3_evm Didn't you fix the issues? and leave it on for mcx and see who has time and hardware to fix things for v2012.10. Or we fix it for mcx too until .07 is out ? Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 3/6] mcx: Disable DCACHE since USB EHCI is enabled
On 06/28/2012 03:36 PM, Marek Vasut wrote: Dear Tom Rini, On Fri, Jun 29, 2012 at 12:01:58AM +0200, Marek Vasut wrote: Dear Tom Rini, On 06/28/2012 07:37 AM, Marek Vasut wrote: Dear Ilya Yanok, Dear Marek, 28.06.2012 02:48, Marek Vasut wrote: Sorry for missing this discussion. I think compile-time disabling of the cache is too brutal. ehci-hcd cache handling is broken anyway: doing unaligned flushes/invalidates is a bug, and we know for sure that upper layers don't care about alignment (and I bet ehci-hcd does this even for its internal buffers). So what's the point in all this cache handling in ehci-hcd? It's not going to work anyway and just produces problems. So I suggest to just disable all this stuff until generic code will be fixed. Alternatively we can do bounce-buffering inside driver. We should rather introduce generic bounce buffer. But the upper layers are getting fixed recently so we should be getting there. Really? Don't forget my old patch [1] then ;) Still I think we should rip off all the cache stuff from ehci-hcd until all patches for upper layers are included. Again, this stuff doesn't do proper things now anyway and USB won't work with dcache enabled. Have you tested? I enabled dcache on m28 and tried asix ethernet (needed a patch) and loading from ext2 and vfat (worked). So then we have more places that accidentially aligned to 32bytes since this does not work on TI parts which require 64byte alignment. Oh, this is very good it's broken. People actually started whining. Now we have to wait until they start identifying the problematic places and fixing them. Uh-hunh. So I guess for v2012.07 we'll build-time disable dcache for beagle and omap3_evm Didn't you fix the issues? and leave it on for mcx and see who has time and hardware to fix things for v2012.10. Or we fix it for mcx too until .07 is out ? To clarify for everyone, the first part of this series fixes some alignment issues for things that were not starting address aligned. There still exist end-address alignment issues within ehci-hcd. The time I have for this problem right now boils down to disable dcache for these boards so that USB is still functional. -- Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 3/6] mcx: Disable DCACHE since USB EHCI is enabled
Dear Tom Rini, On 06/28/2012 03:36 PM, Marek Vasut wrote: Dear Tom Rini, On Fri, Jun 29, 2012 at 12:01:58AM +0200, Marek Vasut wrote: Dear Tom Rini, On 06/28/2012 07:37 AM, Marek Vasut wrote: Dear Ilya Yanok, Dear Marek, 28.06.2012 02:48, Marek Vasut wrote: Sorry for missing this discussion. I think compile-time disabling of the cache is too brutal. ehci-hcd cache handling is broken anyway: doing unaligned flushes/invalidates is a bug, and we know for sure that upper layers don't care about alignment (and I bet ehci-hcd does this even for its internal buffers). So what's the point in all this cache handling in ehci-hcd? It's not going to work anyway and just produces problems. So I suggest to just disable all this stuff until generic code will be fixed. Alternatively we can do bounce-buffering inside driver. We should rather introduce generic bounce buffer. But the upper layers are getting fixed recently so we should be getting there. Really? Don't forget my old patch [1] then ;) Still I think we should rip off all the cache stuff from ehci-hcd until all patches for upper layers are included. Again, this stuff doesn't do proper things now anyway and USB won't work with dcache enabled. Have you tested? I enabled dcache on m28 and tried asix ethernet (needed a patch) and loading from ext2 and vfat (worked). So then we have more places that accidentially aligned to 32bytes since this does not work on TI parts which require 64byte alignment. Oh, this is very good it's broken. People actually started whining. Now we have to wait until they start identifying the problematic places and fixing them. Uh-hunh. So I guess for v2012.07 we'll build-time disable dcache for beagle and omap3_evm Didn't you fix the issues? and leave it on for mcx and see who has time and hardware to fix things for v2012.10. Or we fix it for mcx too until .07 is out ? To clarify for everyone, the first part of this series fixes some alignment issues for things that were not starting address aligned. There still exist end-address alignment issues within ehci-hcd. The time I have for this problem right now boils down to disable dcache for these boards so that USB is still functional. To clarify it even further -- it always worked just by sheer coincidence ... Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] net: sh_eth: add SH_ETH_TYPE_ condition
Tested-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com Acked-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com 2012/6/27 Shimoda, Yoshihiro yoshihiro.shimoda...@renesas.com: At the moment, the driver supports the following CPUs: - GETHER (Gigabit Ethernet) : SH7763, SH7734 - ETHER (Fast Ethernet) : SH7724, SH7757 And the driver had the following #if: #if defined(CONFIG_CPU_SH7763) || defined(CONFIG_CPU_SH7734) #if !defined(CONFIG_CPU_SH7757) !defined(CONFIG_CPU_SH7724) - Those are for GETHER #if defined(CONFIG_CPU_SH7724) || defined(CONFIG_CPU_SH7757) - This is for ETHER So, for clean up the code, this patch adds SH_ETH_TYPE_GETHER and SH_ETH_TYPE_ETHER. And then, the patch modifies the above #if. Signed-off-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com --- drivers/net/sh_eth.c | 22 +- drivers/net/sh_eth.h | 43 +++ 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 1825059..262762d 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -1,5 +1,5 @@ /* - * sh_eth.c - Driver for Renesas SH7763's ethernet controler. + * sh_eth.c - Driver for Renesas ethernet controler. * * Copyright (C) 2008, 2011 Renesas Solutions Corp. * Copyright (c) 2008, 2011 Nobuhiro Iwamatsu @@ -138,7 +138,7 @@ int sh_eth_recv(struct eth_device *dev) static int sh_eth_reset(struct sh_eth_dev *eth) { int port = eth-port; -#if defined(CONFIG_CPU_SH7763) || defined(CONFIG_CPU_SH7734) +#if defined(SH_ETH_TYPE_GETHER) int ret = 0, i; /* Start e-dmac transmitter and receiver */ @@ -208,7 +208,7 @@ static int sh_eth_tx_desc_init(struct sh_eth_dev *eth) /* Point the controller to the tx descriptor list. Must use physical addresses */ outl(ADDR_TO_PHY(port_info-tx_desc_base), TDLAR(port)); -#if defined(CONFIG_CPU_SH7763) || defined(CONFIG_CPU_SH7734) +#if defined(SH_ETH_TYPE_GETHER) outl(ADDR_TO_PHY(port_info-tx_desc_base), TDFAR(port)); outl(ADDR_TO_PHY(cur_tx_desc), TDFXR(port)); outl(0x01, TDFFR(port));/* Last discriptor bit */ @@ -276,7 +276,7 @@ static int sh_eth_rx_desc_init(struct sh_eth_dev *eth) /* Point the controller to the rx descriptor list */ outl(ADDR_TO_PHY(port_info-rx_desc_base), RDLAR(port)); -#if defined(CONFIG_CPU_SH7763) || defined(CONFIG_CPU_SH7734) +#if defined(SH_ETH_TYPE_GETHER) outl(ADDR_TO_PHY(port_info-rx_desc_base), RDFAR(port)); outl(ADDR_TO_PHY(cur_rx_desc), RDFXR(port)); outl(RDFFR_RDLF, RDFFR(port)); @@ -370,7 +370,7 @@ static int sh_eth_config(struct sh_eth_dev *eth, bd_t *bd) outl(0, TFTR(port)); outl((FIFO_SIZE_T | FIFO_SIZE_R), FDR(port)); outl(RMCR_RST, RMCR(port)); -#if !defined(CONFIG_CPU_SH7757) !defined(CONFIG_CPU_SH7724) +#if defined(SH_ETH_TYPE_GETHER) outl(0, RPADIR(port)); #endif outl((FIFO_F_D_RFF | FIFO_F_D_RFD), FCFTR(port)); @@ -387,14 +387,10 @@ static int sh_eth_config(struct sh_eth_dev *eth, bd_t *bd) outl(val, MALR(port)); outl(RFLR_RFL_MIN, RFLR(port)); -#if !defined(CONFIG_CPU_SH7757) !defined(CONFIG_CPU_SH7724) +#if defined(SH_ETH_TYPE_GETHER) outl(0, PIPR(port)); -#endif -#if !defined(CONFIG_CPU_SH7724) !defined(CONFIG_CPU_SH7757) outl(APR_AP, APR(port)); outl(MPR_MP, MPR(port)); -#endif -#if defined(CONFIG_CPU_SH7763) || defined(CONFIG_CPU_SH7734) outl(TPAUSER_TPAUSE, TPAUSER(port)); #endif @@ -415,7 +411,7 @@ static int sh_eth_config(struct sh_eth_dev *eth, bd_t *bd) /* Set the transfer speed */ if (phy-speed == 100) { printf(SHETHER_NAME : 100Base/); -#if defined(CONFIG_CPU_SH7763) || defined(CONFIG_CPU_SH7734) +#if defined(SH_ETH_TYPE_GETHER) outl(GECMR_100B, GECMR(port)); #elif defined(CONFIG_CPU_SH7757) outl(1, RTRATE(port)); @@ -424,13 +420,13 @@ static int sh_eth_config(struct sh_eth_dev *eth, bd_t *bd) #endif } else if (phy-speed == 10) { printf(SHETHER_NAME : 10Base/); -#if defined(CONFIG_CPU_SH7763) || defined(CONFIG_CPU_SH7734) +#if defined(SH_ETH_TYPE_GETHER) outl(GECMR_10B, GECMR(port)); #elif defined(CONFIG_CPU_SH7757) outl(0, RTRATE(port)); #endif } -#if defined(CONFIG_CPU_SH7763) || defined(CONFIG_CPU_SH7734) +#if defined(SH_ETH_TYPE_GETHER) else if (phy-speed == 1000) { printf(SHETHER_NAME : 1000Base/); outl(GECMR_1000B, GECMR(port)); diff --git a/drivers/net/sh_eth.h b/drivers/net/sh_eth.h index 5276be3..401ef69 100644 --- a/drivers/net/sh_eth.h +++ b/drivers/net/sh_eth.h @@ -99,6 +99,7 @@ struct sh_eth_dev { /* Register Address */ #ifdef CONFIG_CPU_SH7763 +#define SH_ETH_TYPE_GETHER #define BASE_IO_ADDR 0xfee0 #define
Re: [U-Boot] [PATCH 1/4] net: sh_eth: clean up for the SH7757's code
Tested-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com Acked-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com 2012/6/27 Shimoda, Yoshihiro yoshihiro.shimoda...@renesas.com: The SH7757's ETHER can work using the SH7724's setting. So, the patch modifies it. Signed-off-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com --- drivers/net/sh_eth.c | 9 + drivers/net/sh_eth.h | 14 ++ 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index bb57e4d..1825059 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -376,12 +376,7 @@ static int sh_eth_config(struct sh_eth_dev *eth, bd_t *bd) outl((FIFO_F_D_RFF | FIFO_F_D_RFD), FCFTR(port)); /* Configure e-mac registers */ -#if defined(CONFIG_CPU_SH7757) - outl(ECSIPR_BRCRXIP | ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | - ECSIPR_MPDIP | ECSIPR_ICDIP, ECSIPR(port)); -#else outl(0, ECSIPR(port)); -#endif /* Set Mac address */ val = dev-enetaddr[0] 24 | dev-enetaddr[1] 16 | @@ -395,14 +390,12 @@ static int sh_eth_config(struct sh_eth_dev *eth, bd_t *bd) #if !defined(CONFIG_CPU_SH7757) !defined(CONFIG_CPU_SH7724) outl(0, PIPR(port)); #endif -#if !defined(CONFIG_CPU_SH7724) +#if !defined(CONFIG_CPU_SH7724) !defined(CONFIG_CPU_SH7757) outl(APR_AP, APR(port)); outl(MPR_MP, MPR(port)); #endif #if defined(CONFIG_CPU_SH7763) || defined(CONFIG_CPU_SH7734) outl(TPAUSER_TPAUSE, TPAUSER(port)); -#elif defined(CONFIG_CPU_SH7757) - outl(TPAUSER_UNLIMITED, TPAUSER(port)); #endif #if defined(CONFIG_CPU_SH7734) diff --git a/drivers/net/sh_eth.h b/drivers/net/sh_eth.h index 50f4b69..5276be3 100644 --- a/drivers/net/sh_eth.h +++ b/drivers/net/sh_eth.h @@ -319,7 +319,7 @@ enum EESR_BIT { EESR_FTC = 0x0020, EESR_TDE = 0x0010, EESR_TFE = 0x0008, EESR_FRC = 0x0004, EESR_RDE = 0x0002, EESR_RFE = 0x0001, -#if defined(CONFIG_CPU_SH7724) !defined(CONFIG_CPU_SH7757) +#if defined(CONFIG_CPU_SH7724) || defined(CONFIG_CPU_SH7757) EESR_CND = 0x0800, #endif EESR_DLC = 0x0400, @@ -426,9 +426,7 @@ enum FELIC_MODE_BIT { #if defined(CONFIG_CPU_SH7763) || defined(CONFIG_CPU_SH7734) #define ECMR_CHG_DM (ECMR_TRCCM | ECMR_RZPF | ECMR_ZPF | ECMR_PFR | ECMR_RXF | \ ECMR_TXF | ECMR_MCT) -#elif CONFIG_CPU_SH7757 -#define ECMR_CHG_DM (ECMR_ZPF) -#elif CONFIG_CPU_SH7724 +#elif CONFIG_CPU_SH7724 || CONFIG_CPU_SH7757 #define ECMR_CHG_DM (ECMR_ZPF | ECMR_PFR | ECMR_RXF | ECMR_TXF) #else #define ECMR_CHG_DM (ECMR_ZPF | ECMR_PFR | ECMR_RXF | ECMR_TXF | ECMR_MCT) @@ -473,20 +471,12 @@ enum ECSIPR_STATUS_MASK_BIT { /* APR */ enum APR_BIT { -#ifdef CONFIG_CPU_SH7757 - APR_AP = 0x0001, -#else APR_AP = 0x0004, -#endif }; /* MPR */ enum MPR_BIT { -#ifdef CONFIG_CPU_SH7757 - MPR_MP = 0x0001, -#else MPR_MP = 0x0006, -#endif }; /* TRSCER */ -- 1.7.1 -- Nobuhiro Iwamatsu ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/4] net: sh_eth: modify the definitions of regsiter
Tested-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com Acked-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com 2012/6/27 Shimoda, Yoshihiro yoshihiro.shimoda...@renesas.com: The previous code had many similar definitions in each CPU. This patch borrows from the sh_eth driver of Linux kernel. Signed-off-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com --- drivers/net/sh_eth.c | 108 - drivers/net/sh_eth.h | 331 +++--- 2 files changed, 258 insertions(+), 181 deletions(-) diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 262762d..7b429e8 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -76,8 +76,8 @@ int sh_eth_send(struct eth_device *dev, void *packet, int len) port_info-tx_desc_cur-td0 = TD_TACT | TD_TFP; /* Restart the transmitter if disabled */ - if (!(inl(EDTRR(port)) EDTRR_TRNS)) - outl(EDTRR_TRNS, EDTRR(port)); + if (!(sh_eth_read(eth, EDTRR) EDTRR_TRNS)) + sh_eth_write(eth, EDTRR_TRNS, EDTRR); /* Wait until packet is transmitted */ timeout = TIMEOUT_CNT; @@ -129,25 +129,24 @@ int sh_eth_recv(struct eth_device *dev) } /* Restart the receiver if disabled */ - if (!(inl(EDRRR(port)) EDRRR_R)) - outl(EDRRR_R, EDRRR(port)); + if (!(sh_eth_read(eth, EDRRR) EDRRR_R)) + sh_eth_write(eth, EDRRR_R, EDRRR); return len; } static int sh_eth_reset(struct sh_eth_dev *eth) { - int port = eth-port; #if defined(SH_ETH_TYPE_GETHER) int ret = 0, i; /* Start e-dmac transmitter and receiver */ - outl(EDSR_ENALL, EDSR(port)); + sh_eth_write(eth, EDSR_ENALL, EDSR); /* Perform a software reset and wait for it to complete */ - outl(EDMR_SRST, EDMR(port)); + sh_eth_write(eth, EDMR_SRST, EDMR); for (i = 0; i TIMEOUT_CNT ; i++) { - if (!(inl(EDMR(port)) EDMR_SRST)) + if (!(sh_eth_read(eth, EDMR) EDMR_SRST)) break; udelay(1000); } @@ -159,9 +158,9 @@ static int sh_eth_reset(struct sh_eth_dev *eth) return ret; #else - outl(inl(EDMR(port)) | EDMR_SRST, EDMR(port)); + sh_eth_write(eth, sh_eth_read(eth, EDMR) | EDMR_SRST, EDMR); udelay(3000); - outl(inl(EDMR(port)) ~EDMR_SRST, EDMR(port)); + sh_eth_write(eth, sh_eth_read(eth, EDMR) ~EDMR_SRST, EDMR); return 0; #endif @@ -207,11 +206,11 @@ static int sh_eth_tx_desc_init(struct sh_eth_dev *eth) /* Point the controller to the tx descriptor list. Must use physical addresses */ - outl(ADDR_TO_PHY(port_info-tx_desc_base), TDLAR(port)); + sh_eth_write(eth, ADDR_TO_PHY(port_info-tx_desc_base), TDLAR); #if defined(SH_ETH_TYPE_GETHER) - outl(ADDR_TO_PHY(port_info-tx_desc_base), TDFAR(port)); - outl(ADDR_TO_PHY(cur_tx_desc), TDFXR(port)); - outl(0x01, TDFFR(port));/* Last discriptor bit */ + sh_eth_write(eth, ADDR_TO_PHY(port_info-tx_desc_base), TDFAR); + sh_eth_write(eth, ADDR_TO_PHY(cur_tx_desc), TDFXR); + sh_eth_write(eth, 0x01, TDFFR);/* Last discriptor bit */ #endif err: @@ -275,11 +274,11 @@ static int sh_eth_rx_desc_init(struct sh_eth_dev *eth) cur_rx_desc-rd0 |= RD_RDLE; /* Point the controller to the rx descriptor list */ - outl(ADDR_TO_PHY(port_info-rx_desc_base), RDLAR(port)); + sh_eth_write(eth, ADDR_TO_PHY(port_info-rx_desc_base), RDLAR); #if defined(SH_ETH_TYPE_GETHER) - outl(ADDR_TO_PHY(port_info-rx_desc_base), RDFAR(port)); - outl(ADDR_TO_PHY(cur_rx_desc), RDFXR(port)); - outl(RDFFR_RDLF, RDFFR(port)); + sh_eth_write(eth, ADDR_TO_PHY(port_info-rx_desc_base), RDFAR); + sh_eth_write(eth, ADDR_TO_PHY(cur_rx_desc), RDFXR); + sh_eth_write(eth, RDFFR_RDLF, RDFFR); #endif return ret; @@ -364,38 +363,39 @@ static int sh_eth_config(struct sh_eth_dev *eth, bd_t *bd) struct phy_device *phy; /* Configure e-dmac registers */ - outl((inl(EDMR(port)) ~EMDR_DESC_R) | EDMR_EL, EDMR(port)); - outl(0, EESIPR(port)); - outl(0, TRSCER(port)); - outl(0, TFTR(port)); - outl((FIFO_SIZE_T | FIFO_SIZE_R), FDR(port)); - outl(RMCR_RST, RMCR(port)); + sh_eth_write(eth, (sh_eth_read(eth, EDMR) ~EMDR_DESC_R) | EDMR_EL, + EDMR); + sh_eth_write(eth, 0, EESIPR); + sh_eth_write(eth, 0, TRSCER); + sh_eth_write(eth, 0, TFTR); + sh_eth_write(eth, (FIFO_SIZE_T | FIFO_SIZE_R), FDR); + sh_eth_write(eth, RMCR_RST, RMCR); #if defined(SH_ETH_TYPE_GETHER) - outl(0, RPADIR(port)); + sh_eth_write(eth, 0, RPADIR); #endif - outl((FIFO_F_D_RFF | FIFO_F_D_RFD), FCFTR(port)); + sh_eth_write(eth,
Re: [U-Boot] [PATCH 4/4] net: sh_eth: add support for SH7757's GETHER
Tested-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com Acked-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com 2012/6/27 Shimoda, Yoshihiro yoshihiro.shimoda...@renesas.com: SH7757 has 2 ETHERs and 2 GETHERs. This patch supports the SH7757's GETHER. If CONFIG_SH_ETHER_USE_GETHER is defined using SH7757, the driver handles the GETHER. Signed-off-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com --- drivers/net/sh_eth.h | 9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/net/sh_eth.h b/drivers/net/sh_eth.h index 13003ec..3703c55 100644 --- a/drivers/net/sh_eth.h +++ b/drivers/net/sh_eth.h @@ -282,8 +282,13 @@ static const u16 sh_eth_offset_fast_sh4[SH_ETH_MAX_REGISTER_OFFSET] = { #define SH_ETH_TYPE_GETHER #define BASE_IO_ADDR 0xfee0 #elif defined(CONFIG_CPU_SH7757) +#if defined(CONFIG_SH_ETHER_USE_GETHER) +#define SH_ETH_TYPE_GETHER +#define BASE_IO_ADDR 0xfee0 +#else #define SH_ETH_TYPE_ETHER #define BASE_IO_ADDR 0xfef0 +#endif #elif defined(CONFIG_CPU_SH7724) #define SH_ETH_TYPE_ETHER #define BASE_IO_ADDR 0xA460 @@ -331,7 +336,11 @@ enum DMAC_T_BIT { /* GECMR */ enum GECMR_BIT { +#if defined(CONFIG_CPU_SH7757) + GECMR_1000B = 0x20, GECMR_100B = 0x01, GECMR_10B = 0x00, +#else GECMR_1000B = 0x01, GECMR_100B = 0x04, GECMR_10B = 0x00, +#endif }; /* EDRRR*/ -- 1.7.1 -- Nobuhiro Iwamatsu ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] nand: Hack to support 4k page in fsl_elbc_nand
On Thu, Jun 28, 2012 at 10:36 PM, Scott Wood scottw...@freescale.com wrote: On 06/28/2012 03:47 PM, Rafael Beims wrote: Freescale FCM controller has a 2K size limitation of buffer RAM. In order to support the Nand flash chip with pagesize larger than 2K bytes, we read/write 2k data repeatedly by issuing FIR_OP_RB/FIR_OP_WB and save them to a large buffer. Because of this, the in flash layout of the oob is different from the default for 4096kiB page sizes. Therefore, we need to migrate the factory bad block markers from the original position to the new layout. Signed-off-by: Shengzhou Liu shengzhou@freescale.com Signed-off-by: Liu Shuo b35...@freescale.com Signed-off-by: Rafael Beims rafael.be...@datacom.ind.br --- Changes in v2: - Added check to disallow the migration code to run in devices with page size = 2048 drivers/mtd/nand/fsl_elbc_nand.c | 447 +++--- 1 files changed, 419 insertions(+), 28 deletions(-) Thanks for working on this! I've been meaning to for a while, but have been busy with other things. diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index 9076ad4..3b6bb1d 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c @@ -76,15 +76,17 @@ struct fsl_elbc_ctrl { /* device info */ fsl_lbc_t *regs; - u8 __iomem *addr; /* Address of assigned FCM buffer */ - unsigned int page; /* Last page written to / read from */ - unsigned int read_bytes; /* Number of bytes read during command */ - unsigned int column; /* Saved column from SEQIN */ - unsigned int index; /* Pointer to next byte to 'read' */ - unsigned int status; /* status read from LTESR after last op */ - unsigned int mdr; /* UPM/FCM Data Register value */ - unsigned int use_mdr; /* Non zero if the MDR is to be set */ - unsigned int oob; /* Non zero if operating on OOB data */ + u8 __iomem *addr; /* Address of assigned FCM buffer */ + unsigned int page; /* Last page written to / read from */ + unsigned int read_bytes; /* Number of bytes read during command */ + unsigned int column; /* Saved column from SEQIN */ + unsigned int index; /* Pointer to next byte to 'read' */ + unsigned int status; /* status read from LTESR after last op */ + unsigned int mdr; /* UPM/FCM Data Register value */ + unsigned int use_mdr; /* Non zero if the MDR is to be set */ + unsigned int oob; /* Non zero if operating on OOB data */ + char *buffer; /* Just used when pagesize is greater */ + /* than FCM RAM 2K limitation */ }; /* These map to the positions used by the FCM hardware ECC generator */ @@ -131,6 +133,15 @@ static struct nand_bbt_descr largepage_memorybased = { .pattern = scan_ff_pattern, }; +static u8 migrated_pattern[] = { 0xde, 0xad, 0xde, 0xad }; Let's generate a proper random number here -- or at least a meaningful ASCII string. Things like the above are too common and invite magic number collision. Will do it. +static int fsl_elbc_migrate_badblocks(struct mtd_info *mtd, + struct nand_bbt_descr *bd) +{ + struct nand_chip *this = mtd-priv; + int len, numblocks, i; + int startblock; + loff_t from; + uint8_t *newoob, *buf; + + struct fsl_elbc_mtd *priv = this-priv; + struct fsl_elbc_ctrl *ctrl = priv-ctrl; + + int num_subpages = mtd-writesize / 2048-1; + len = mtd-writesize + mtd-oobsize; + numblocks = this-chipsize (this-phys_erase_shift - 1); + startblock = 0; + from = 0; + + newoob = vmalloc(mtd-oobsize); Even if this were Linux, oobsize should never be big enough to need vmalloc. + memset(newoob, 0xff, mtd-writesize+mtd-oobsize); You're writing beyond the end of that buffer. I should have reviewed this code better... Will fix that. + for (i = startblock; i numblocks; i += 2) { + int page = (from this-page_shift) this-pagemask; + fsl_elbc_cmdfunc(mtd, NAND_CMD_READ0, 0, page); + + /* As we are already using the hack to read the bytes + * from NAND, the original badblock marker is offset + * from its original location in the internal buffer. + * This is because the hack reads 2048 + 64 and already + * positions the spare in the correct region + * (after the 4096 offset) + */ + uint8_t *badblock_pattern = (ctrl-buffer+ + mtd-writesize-(num_subpages*64))+bd-offs; Spaces around operators. I think that should be (num_subpages - 1) *
Re: [U-Boot] ARM CONFIG_OF_CONTROL status
Hi, On Wed, Jun 27, 2012 at 11:49 PM, Michal Simek mon...@monstr.eu wrote: On 06/28/2012 07:57 AM, Simon Glass wrote: Hi Michal, On Wed, Jun 27, 2012 at 10:50 PM, Michal Simek mon...@monstr.eu mailto: mon...@monstr.eu wrote: Hi Simon, On 06/28/2012 03:10 AM, Simon Glass wrote: Hi Michal, On Wed, Jun 27, 2012 at 7:35 AM, Michal Simek mon...@monstr.eumailto: mon...@monstr.eu mailto:mon...@monstr.eu mailto:mon...@monstr.eu wrote: Hi Simon, On 06/27/2012 03:58 PM, Simon Glass wrote: Hi, On Wed, Jun 27, 2012 at 2:29 AM, Michal Simek mon...@monstr.eu mailto:mon...@monstr.eu mailto:mon...@monstr.eumailto: mon...@monstr.eu mailto:mon...@monstr.eu mailto:mon...@monstr.eu mailto:mon...@monstr.eu mailto:mon...@monstr.eu wrote: Hi, can you please update me about current state of CONFIG_OF_CONTROL for ARM? Are there any other archs/boards which will use this option? Or any other git repo out of mainline u-boot? Exynos is in progress - development is happening in the Chromium tree and being upstreamed in chunks (although no fdt patches have been sent yet). ok. Has someone tried to look for devices based on compatible property? I see that in usb driver it is based on aliases which is not the best solution. U-Boot doesn't yet have a device model which would allow this in the general case. For now, drivers look for their own compatible nodes. This works well enough until we have a device model. There are other limitations also - for example USB supports only a single controller type working at one time (a restriction we may need to look at to support USB2 and USB3 together). So even if two USB drivers decided that they both found compatible nodes, only one of them could operate. So for now aliases provide just an ordering, nothing else. I have looked at the code and did some tests on Microblaze. Firstly I have tried to change emaclite ethernet initialization and I ended with this code fragment which could be broadly used by other drivers. int offset = 0; do { offset = fdt_node_offset_by_compatible(**gd-fdt_blob, offset, xlnx,xps-ethernetlite-1.00.a ); You could check if offset 0 here, or !fdtdec_get_is_enabled(gd-__**fdt_blob, offset) u32 rxpp = fdtdec_get_int(gd-fdt_blob, offset, xlnx,rx-ping-pong, 0); u32 txpp = fdtdec_get_int(gd-fdt_blob, offset, xlnx,tx-ping-pong, 0); u32 reg = fdtdec_get_int(gd-fdt_blob, offset, reg, 0); Maybe fdtdec_get_addr() yeah right. do { offset = fdt_node_offset_by_compatible(**__gd-fdt_blob, offset, xlnx,xps-ethernetlite-1.00.a ); u32 rxpp = fdtdec_get_int(gd-fdt_blob, offset, xlnx,rx-ping-pong, 0); u32 txpp = fdtdec_get_int(gd-fdt_blob, offset, xlnx,tx-ping-pong, 0); u32 reg = fdtdec_get_addr(gd-fdt_blob, offset, reg); if (reg != FDT_ADDR_T_NONE) ret |= xilinx_emaclite_initialize(__**bis, reg, txpp, rxpp); } while (offset != -1); if (reg) ret |= xilinx_emaclite_initialize(___* *_bis, reg, txpp, rxpp); } while (offset != -1); What do you think? This code is in platform file. Seems reasonable to me. ok. Also I have tested code around aliases which parse DTS aliases list for console initialization and I have also get it work for !CONSOLE_SERIAL_MULTI case. Great - I did send a patch to the list for fdt serial, but haven't really got back to it. Can you give me link to it or just subject? WIP: fdt: Add serial port controlled by device tree These are the related commits in the Chromium tree. I will get to upstreaming these at some point. 1fe36bf gen: serial: Disable FDT serial console if requested c80331f gen: Adjust fdt console to be silent if no alias present 2006b07 gen: fdt: Add serial port controlled by device tree 711f29d fixup: gen: fdt: Fix compile-time errors 0c8fc5d lost: gen: x86: Allow NS16550 driver to support IO and memory mapped reg da92af5 gen: Fix a compiler warning in serial_fdt.c ab1d572 gen: fdt: silence console in response to device tree 'silent' option 376c215 lost: gen: fdt: Add serial port controlled by device tree Can you also send me link to Chromium tree? Yes this should work: https://git.chromium.org/git/chromiumos/third_party/u-boot.git I am going to send RFC for emaclite driver
Re: [U-Boot] NAND DMA timed out with i.mx boot source code.
No network on my board, so nand_update_full can't be run. I use command kobs-ng init u-boot.sb to update(default: /dev/mtd0) or mfgtools from freescale. I just add support NAND to mx28evk configs file copied from m28evk configs. Sub-page size of nand flash is 2048bytes with oob size is 64byte, and size is 128M. At 2012-06-28 18:49:39,Marek Vasut ma...@denx.de wrote: Dear alex, Hi: I have one board which hardware copied from mx28evk board, and compiled the source code cloned from u-boot mainline git. The rom in mx28 print 0x80508008, that is NAND DMA timed out. I compile the source from u-boot-testing, and it's no any wrong print, and the start is OK. I don't know why result in this issue. u-boot-testing is quite ancient. But the code you're getting is during bootrom booting from NAND, not in uboot, correct? Does your nand chip have 2048b pages with 64b OOB? Did you use nand_update_full() to reload the NAND? Best Regards, Alex Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] NAND DMA timed out with i.mx boot source code.
No sd support on my board. I use the the latest code. update by command kobs-ng init u-boot.sb, and give error as below: mtd: erase stepping bounds mtd: Failed to erase block @0x1e mtd: Failed to write BS#1 FAILED to commit structures At 2012-06-29 10:51:58,Fabio Estevam feste...@gmail.com wrote: On Thu, Jun 28, 2012 at 11:24 PM, alex laub...@163.com wrote: No network on my board, so nand_update_full can't be run. I use command kobs-ng init u-boot.sb to update(default: /dev/mtd0) or mfgtools from freescale. I just add support NAND to mx28evk configs file copied from m28evk configs. There is NAND support on mx28evk.h in mainline. Looks like you are using old code. Please use the latest mainline code and try again. Are you able to boot from SD card on your board? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot