[U-Boot] P2020RDB: Error while using P2020RDB_SDCARD
Hi, I'm building u-boot from the git master for a powerpc target. I'm using the P2020RDB_SDCARD configuration. During the final link I get: uboot/arch/powerpc/cpu/mpc85xx/start.S:1118: relocation truncated to fit: R_PPC_REL24 against symbol `_start_cont' defined in .text section in arch/powerpc/cpu/mpc85xx/start.o I'm using gcc 4.3.2. Any clue ? Franck. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] P2020RDB: Error while using P2020RDB_SDCARD
2013/4/25 Wolfgang Denk > Dear Franck Jullien, > > In message < > cajfokbwjyrtqnhub5gotxcpob_xneirnoz+b97ksvsy0fcx...@mail.gmail.com> you > wrote: > > > > I'm building u-boot from the git master for a powerpc target. I'm using > > the P2020RDB_SDCARD configuration. > > > > During the final link I get: uboot/arch/powerpc/cpu/mpc85xx/start.S:1118: > > relocation truncated to fit: R_PPC_REL24 against symbol `_start_cont' > > defined in .text section in arch/powerpc/cpu/mpc85xx/start.o > > I cannot confirm that: > > -> ./MAKEALL P2020RDB_SDCARD > Configuring for P2020RDB_SDCARD - Board: P1_P2_RDB, Options: > P2020RDB,SDCARD >textdata bss dec hex filename > 399825 23492 276304 699621 aace5 ./u-boot > > - SUMMARY > Boards compiled: 1 > -- > > > I'm using gcc 4.3.2. > > Well, you should try working on a spaceship (or, rather, a U-Boot :-) > with only a handaxe as a tool. Please get a recent version of a tool > chain for recent versions of the code. See for example [1]. > > [1] http://www.denx.de/wiki/view/ELDK-5/WebHome#Section_1.6.1. > > Best regards, > > Wolfgang Denk > > -- > DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de > The right word may be effective, but no word was ever as effective as > a rightly timed pause. - Mark Twain > Hi, The spaceship is now fixed :) I trew away my gcc/"hand axe" got from ltib and it's now much better. Thanks. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] T1040 booting from NOR Flash
Hi, I'd like to know if I have understood it correctly. When first time booting from NOR, the RCW and PBI must be written using the JTAG. The last instruction of the PBI must be a jump (0x13_8080) to the user's code (uboot here). Am I right ? Best regards, Franck. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] T1040 booting from NOR Flash
2014-02-13 1:56 GMT+01:00 Rommel G Custodio : > Dear Franck Jullien, > > Franck Jullien gmail.com> writes: > >> >> Hi, >> >> I'd like to know if I have understood it correctly. >> >> When first time booting from NOR, the RCW and PBI must be written >> using the JTAG. The last instruction of the PBI must be a jump >> (0x13_8080) to the user's code (uboot here). > > You should not need to bring out the JTAG. > > The build process for other FSL boards that require RCW (i.e. P5040) can > create a single binary that includes RCW, PBI, and u-boot. > > BUT the T1040 right now does not have a build target that creates this > binary! It seems FSL hasn't gotten about to creating it yet (not in mailine, > not in patchworks, none in the FSL SDK). > >> >> Am I right ? >> >> Best regards, >> >> Franck. >> > > All the best, > Rommel > > > ___ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot I did see other platforms generates PBL images with RCW and PBI built-in. However, this is always with CONFIG_RAMBOOT_PBL set (SPI, NAND or SD-CARD boot). This is the memory map described in the t104xrdb/README file: NOR Flash memory Map - 163 Start End Definition Size 164 0xEFF4 0xEFFF u-boot (current bank)768KB 177 0xE800 0xE801 RCW (current bank) 128KB For me, it means the RCW will not be included in the u-boot binary. Franck. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] openrisc: fix relocation code
The relocation code can now relocate from anywhere to the RAM. The old code assumed that the binary was copied to the RAM by some PBL and then it just relocated the .text section from the loaded address to the linked address. Now, it first checks if vectors are somewhere else than the linked address. If yes, there are copied to address 0 (or to the exception vector base address if register EVBAR is present). Then, the .text section is relocated from its current location to the RAM. Signed-off-by: Franck Jullien --- arch/openrisc/cpu/start.S | 55 +--- 1 files changed, 41 insertions(+), 14 deletions(-) diff --git a/arch/openrisc/cpu/start.S b/arch/openrisc/cpu/start.S index 39c80e1..148242b 100644 --- a/arch/openrisc/cpu/start.S +++ b/arch/openrisc/cpu/start.S @@ -1,6 +1,7 @@ /* * (C) Copyright 2011, Stefan Kristiansson * (C) Copyright 2011, Julius Baxter + * (C) Copyright 2014, Franck Jullien * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -53,9 +54,48 @@ __reset: l.ori r3,r0,SPR_SR_SM l.mtspr r0,r3,SPR_SR + l.jal _cur + l.nop +_cur: + l.ori r8, r9, 0 /* Get _cur current address */ + + l.movhi r3, hi(_cur) + l.ori r3, r3, lo(_cur) + l.sfeq r8, r3 /* If we are running at the linked address */ + l.bf_no_vector_reloc/* there is not need for relocation */ +l.sub r8, r8, r3 + + l.mfspr r4, r0, SPR_CPUCFGR + l.andi r4, r4, SPR_CPUCFGR_EVBARP /* Exception Vector Base Address Register present ? */ + l.sfnei r4,0 + l.bnf _reloc_vectors + l.movhi r5, 0 /* Destination */ + + l.mfspr r4, r0, SPR_EVBAR + l.add r5, r5, r4 + +_reloc_vectors: + /* Relocate vectors*/ + l.movhi r5, 0 /* Destination */ + l.movhi r6, hi(__start) /* Length */ + l.ori r6, r6, lo(__start) + l.ori r3, r8, 0 + +.L_relocvectors: + l.lwz r7, 0(r3) + l.sw0(r5), r7 + l.addi r5, r5, 4 + l.sfeq r5, r6 + l.bnf .L_relocvectors +l.addi r3, r3, 4 + +_no_vector_reloc: + /* Relocate u-boot */ - l.movhi r3,hi(__start) /* source start address */ + l.movhi r3,hi(__start) /* source start offset */ l.ori r3,r3,lo(__start) + l.add r3,r8,r3 + l.movhi r4,hi(_stext) /* dest start address */ l.ori r4,r4,lo(_stext) l.movhi r5,hi(__end)/* dest end address */ @@ -69,19 +109,6 @@ __reset: l.bf.L_reloc l.addi r4,r4,4 /* delay slot */ -#ifdef CONFIG_SYS_RELOCATE_VECTORS - /* Relocate vectors from 0xf000 to 0x */ - l.movhi r4, 0xf000 /* source */ - l.movhi r5, 0 /* destination */ - l.addi r6, r5, CONFIG_SYS_VECTORS_LEN /* length */ -.L_relocvectors: - l.lwz r7, 0(r4) - l.sw0(r5), r7 - l.addi r5, r5, 4 - l.sfeq r5,r6 - l.bnf .L_relocvectors -l.addi r4,r4, 4 -#endif l.movhi r4,hi(_start) l.ori r4,r4,lo(_start) l.jrr4 -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] openrisc: update SPR registers definition
The OpenRISC architecture specification v1.0 defines new SPR registers. This patch adds registers definition for group 0 and update bit definitions for the CPU configuration register. Signed-off-by: Franck Jullien --- arch/openrisc/include/asm/spr-defs.h | 13 - 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/arch/openrisc/include/asm/spr-defs.h b/arch/openrisc/include/asm/spr-defs.h index cb0cdfa..b3b08db 100644 --- a/arch/openrisc/include/asm/spr-defs.h +++ b/arch/openrisc/include/asm/spr-defs.h @@ -49,6 +49,11 @@ #define SPR_ICCFGR (SPRGROUP_SYS + 6) #define SPR_DCFGR (SPRGROUP_SYS + 7) #define SPR_PCCFGR (SPRGROUP_SYS + 8) +#define SPR_VR2(SPRGROUP_SYS + 9) +#define SPR_AVR(SPRGROUP_SYS + 10) +#define SPR_EVBAR (SPRGROUP_SYS + 11) +#define SPR_AECR (SPRGROUP_SYS + 12) +#define SPR_AESR (SPRGROUP_SYS + 13) #define SPR_NPC(SPRGROUP_SYS + 16) #define SPR_SR (SPRGROUP_SYS + 17) #define SPR_PPC(SPRGROUP_SYS + 18) @@ -164,7 +169,13 @@ #define SPR_CPUCFGR_OF32S 0x0080 /* ORFPX32 supported */ #define SPR_CPUCFGR_OF64S 0x0100 /* ORFPX64 supported */ #define SPR_CPUCFGR_OV64S 0x0200 /* ORVDX64 supported */ -#define SPR_CPUCFGR_RES0xfc00 /* Reserved */ +#define SPR_CPUCFGR_ND 0x0400 /* No delay slot */ +#define SPR_CPUCFGR_AVRP 0x0800 /* Arch. Version Register present */ +#define SPR_CPUCFGR_EVBARP 0x1000 /* Exception Vector Base Address Register (EVBAR) present */ +#define SPR_CPUCFGR_ISRP 0x2000 /* Implementation-Specific Registers (ISR0-7) present */ +#define SPR_CPUCFGR_AECSRP 0x4000 /* Arithmetic Exception Control Register (AECR) and */ + /* Arithmetic Exception Status Register (AESR) presents */ +#define SPR_CPUCFGR_RES0xc000 /* Reserved */ /* * Bit definitions for the Debug configuration register and other -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] usb_storage : scan all interfaces to find a storage device
From: Franck Jullien Mass storage is not necessary present on interface 0. This patch allow usb_stor_scan to look in every available interface. Signed-off-by: Franck Jullien --- common/usb_storage.c | 32 +--- 1 files changed, 17 insertions(+), 15 deletions(-) diff --git a/common/usb_storage.c b/common/usb_storage.c index 1411737..a9160fd 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -215,7 +215,7 @@ static unsigned int usb_get_max_lun(struct us_data *us) */ int usb_stor_scan(int mode) { - unsigned char i; + unsigned char i, iface; struct usb_device *dev; if (mode == 1) @@ -241,20 +241,22 @@ int usb_stor_scan(int mode) if (dev == NULL) break; /* no more devices available */ - if (usb_storage_probe(dev, 0, &usb_stor[usb_max_devs])) { - /* OK, it's a storage device. Iterate over its LUNs -* and populate `usb_dev_desc'. -*/ - int lun, max_lun, start = usb_max_devs; - - max_lun = usb_get_max_lun(&usb_stor[usb_max_devs]); - for (lun = 0; -lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV; -lun++) { - usb_dev_desc[usb_max_devs].lun = lun; - if (usb_stor_get_info(dev, &usb_stor[start], - &usb_dev_desc[usb_max_devs]) == 1) { - usb_max_devs++; + for (iface = 0; iface < dev->config.no_of_if; iface++) { + if (usb_storage_probe(dev, 0, &usb_stor[usb_max_devs])) { + /* OK, it's a storage device. Iterate over its LUNs +* and populate `usb_dev_desc'. +*/ + int lun, max_lun, start = usb_max_devs; + + max_lun = usb_get_max_lun(&usb_stor[usb_max_devs]); + for (lun = 0; +lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV; +lun++) { + usb_dev_desc[usb_max_devs].lun = lun; + if (usb_stor_get_info(dev, &usb_stor[start], + &usb_dev_desc[usb_max_devs]) == 1) { + usb_max_devs++; + } } } } -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] usb_storage : scan all interfaces to find a storage device
2015-03-03 23:28 GMT+01:00 Marek Vasut : > On Tuesday, March 03, 2015 at 10:17:11 PM, franck.jull...@gmail.com wrote: >> From: Franck Jullien >> >> Mass storage is not necessary present on interface 0. This >> patch allow usb_stor_scan to look in every available interface. >> >> Signed-off-by: Franck Jullien > > Hi! > > Do you happen to have such a device which isn't present on interface 0? > > Also, can you please rework the patch such that level of indentation would > be reasonably low? Possibly by factoring some code into a separate function? > I see that the code already has some really nasty indent and your patch even > adds to that. > > Thank you! > > Best regards, > Marek Vasut I do have such a device. However, that's a custom one. For some reasons we couldn't put the mass storage device to interface 0. I was wondering about the level of indentation. You confirmed I need to work on it. Thanks for your comments, I'll send a v2 soon. Franck. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] usb_storage : scan all interfaces to find a storage device
From: Franck Jullien Mass storage is not necessary present on interface 0. This patch allow usb_stor_scan to look in every available interface. Signed-off-by: Franck Jullien --- v2: create a new function to improve indentation common/usb_storage.c | 45 - 1 files changed, 28 insertions(+), 17 deletions(-) diff --git a/common/usb_storage.c b/common/usb_storage.c index 1411737..8a490d3 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -208,6 +208,30 @@ static unsigned int usb_get_max_lun(struct us_data *us) return (len > 0) ? *result : 0; } +static int usb_storage_register(struct usb_device *dev, unsigned char iface) +{ + int lun, max_lun, start = usb_max_devs; + int nb_dev = 0; + + if (usb_storage_probe(dev, iface, &usb_stor[usb_max_devs])) { + /* OK, it's a storage device. Iterate over its LUNs +* and populate `usb_dev_desc'. +*/ + max_lun = usb_get_max_lun(&usb_stor[usb_max_devs]); + for (lun = 0; +lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV; +lun++) { + usb_dev_desc[usb_max_devs].lun = lun; + if (usb_stor_get_info(dev, &usb_stor[start], + &usb_dev_desc[usb_max_devs]) == 1) { + nb_dev++; + } + } + } + + return nb_dev; +} + /*** * scan the usb and reports device info * to the user if mode = 1 @@ -215,7 +239,7 @@ static unsigned int usb_get_max_lun(struct us_data *us) */ int usb_stor_scan(int mode) { - unsigned char i; + unsigned char i, iface; struct usb_device *dev; if (mode == 1) @@ -241,23 +265,10 @@ int usb_stor_scan(int mode) if (dev == NULL) break; /* no more devices available */ - if (usb_storage_probe(dev, 0, &usb_stor[usb_max_devs])) { - /* OK, it's a storage device. Iterate over its LUNs -* and populate `usb_dev_desc'. -*/ - int lun, max_lun, start = usb_max_devs; - - max_lun = usb_get_max_lun(&usb_stor[usb_max_devs]); - for (lun = 0; -lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV; -lun++) { - usb_dev_desc[usb_max_devs].lun = lun; - if (usb_stor_get_info(dev, &usb_stor[start], - &usb_dev_desc[usb_max_devs]) == 1) { - usb_max_devs++; - } - } + for (iface = 0; iface < dev->config.no_of_if; iface++) { + usb_max_devs += usb_storage_register(dev, iface); } + /* if storage device */ if (usb_max_devs == USB_MAX_STOR_DEV) { printf("max USB Storage Device reached: %d stopping\n", -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3] usb_storage : scan all interfaces to find a storage device
From: Franck Jullien Mass storage is not necessary present on interface 0. This patch allow usb_stor_scan to look in every available interface. Signed-off-by: Franck Jullien --- v2: create a new function to improve indentation v3: more indentation improvement common/usb_storage.c | 45 - 1 files changed, 28 insertions(+), 17 deletions(-) diff --git a/common/usb_storage.c b/common/usb_storage.c index 1411737..05c96a8 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -208,6 +208,30 @@ static unsigned int usb_get_max_lun(struct us_data *us) return (len > 0) ? *result : 0; } +static int usb_storage_register(struct usb_device *dev, unsigned char iface) +{ + int lun, max_lun, start = usb_max_devs; + int nb_dev = 0; + + if (!usb_storage_probe(dev, iface, &usb_stor[usb_max_devs])) + return nb_dev; + + /* +* OK, it's a storage device. Iterate over its LUNs +* and populate `usb_dev_desc'. +*/ + max_lun = usb_get_max_lun(&usb_stor[usb_max_devs]); + for (lun = 0; lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV; lun++) { + usb_dev_desc[usb_max_devs].lun = lun; + if (usb_stor_get_info(dev, &usb_stor[start], + &usb_dev_desc[usb_max_devs]) == 1) { + nb_dev++; + } + } + + return nb_dev; +} + /*** * scan the usb and reports device info * to the user if mode = 1 @@ -215,7 +239,7 @@ static unsigned int usb_get_max_lun(struct us_data *us) */ int usb_stor_scan(int mode) { - unsigned char i; + unsigned char i, iface; struct usb_device *dev; if (mode == 1) @@ -241,23 +265,10 @@ int usb_stor_scan(int mode) if (dev == NULL) break; /* no more devices available */ - if (usb_storage_probe(dev, 0, &usb_stor[usb_max_devs])) { - /* OK, it's a storage device. Iterate over its LUNs -* and populate `usb_dev_desc'. -*/ - int lun, max_lun, start = usb_max_devs; - - max_lun = usb_get_max_lun(&usb_stor[usb_max_devs]); - for (lun = 0; -lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV; -lun++) { - usb_dev_desc[usb_max_devs].lun = lun; - if (usb_stor_get_info(dev, &usb_stor[start], - &usb_dev_desc[usb_max_devs]) == 1) { - usb_max_devs++; - } - } + for (iface = 0; iface < dev->config.no_of_if; iface++) { + usb_max_devs += usb_storage_register(dev, iface); } + /* if storage device */ if (usb_max_devs == USB_MAX_STOR_DEV) { printf("max USB Storage Device reached: %d stopping\n", -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] usb_storage : scan all interfaces to find a storage device
2015-03-05 14:52 GMT+01:00 Marek Vasut : > On Wednesday, March 04, 2015 at 09:07:00 PM, franck.jull...@gmail.com wrote: >> From: Franck Jullien >> >> Mass storage is not necessary present on interface 0. This >> patch allow usb_stor_scan to look in every available interface. >> >> Signed-off-by: Franck Jullien > > Thanks! > > Acked-by: Marek Vasut > > Are you OK if I apply this for -next (that is, after 2015.04 is out) ? > > Best regards, > Marek Vasut Sure, there is no hurry. Franck. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] usb_storage : scan all interfaces to find a storage device
Hi Simon, 2015-04-17 18:33 GMT+02:00 Simon Glass : > +Tom > > Hi Franck, > > On 4 March 2015 at 13:07, wrote: >> From: Franck Jullien >> >> Mass storage is not necessary present on interface 0. This >> patch allow usb_stor_scan to look in every available interface. >> >> Signed-off-by: Franck Jullien >> --- >> >> v2: create a new function to improve indentation >> >> v3: more indentation improvement >> >> common/usb_storage.c | 45 - >> 1 files changed, 28 insertions(+), 17 deletions(-) >> >> diff --git a/common/usb_storage.c b/common/usb_storage.c >> index 1411737..05c96a8 100644 >> --- a/common/usb_storage.c >> +++ b/common/usb_storage.c >> @@ -208,6 +208,30 @@ static unsigned int usb_get_max_lun(struct us_data *us) >> return (len > 0) ? *result : 0; >> } >> >> +static int usb_storage_register(struct usb_device *dev, unsigned char iface) >> +{ >> + int lun, max_lun, start = usb_max_devs; >> + int nb_dev = 0; >> + >> + if (!usb_storage_probe(dev, iface, &usb_stor[usb_max_devs])) >> + return nb_dev; >> + >> + /* >> +* OK, it's a storage device. Iterate over its LUNs >> +* and populate `usb_dev_desc'. >> +*/ >> + max_lun = usb_get_max_lun(&usb_stor[usb_max_devs]); >> + for (lun = 0; lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV; >> lun++) { >> + usb_dev_desc[usb_max_devs].lun = lun; >> + if (usb_stor_get_info(dev, &usb_stor[start], >> + &usb_dev_desc[usb_max_devs]) == 1) { >> + nb_dev++; > > Should start or usb_max_devs increase here? This will use the same > block_dev_desc_t for each device, won't it? > Good catch. I'll write a patch when I have some time (or someone can do that). However, I won't be able to test it on hardware because I don't have access to it anymore. We could also revert this patch. Sorry for my mistake. Franck. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot