Re: [U-Boot] [PATCH v3 7/8] add support for palm treo 680 board

2013-04-15 Thread Mike Dunn
On 04/14/2013 10:34 AM, Marek Vasut wrote:
 Dear Mike Dunn,
 
 [...]
 
 +int board_init(void)
 +{
 +/* We have RAM, disable cache */
 +dcache_disable();
 +icache_disable();
 +
 +gd-bd-bi_arch_number = MACH_TYPE_TREO680;
 
 This is not needed, just define CONFIG_MACH_TYPE in treo680.h


Oops, yes, I see.


 
 +gd-bd-bi_boot_params = 0xa100;
 
 Is this not CONFIG_SYS_DRAM_BASE + 0x100 ? I think it is.


Correct.

[...]


 +
 +#ifdef CONFIG_MMC
 +int board_mmc_init(bd_t *bis)
 +{
 +writel(0x0400, GPSR(42)); /* power on */
 
 Can you not use your bitlibrary for this stuff? Or maybe at least use (1  
 n) 
 here to make it more readable.


Well, bitrev reverses the bits; not really applicable here.  But you're right, a
shift would be better for clarity.


 
 But seriously, do you not want to (in the longer run) implement proper GPIO 
 driver for PXA? That'd help a lot. Also, do you not want to volunteer to fix 
 PXA? I think it's a bit rotting all around ;-)


Sure, I'd be open to that.


 
 +return pxa_mmc_register(0);
 +}
 +#endif
 +
 +void board_nand_init(void)
 +{
 +/* we have one 128M diskonchip G4  */
 +
 +struct mtd_info *mtd = nand_info[0];
 +struct nand_chip *nand = docg4_nand_chip;
 +if (docg4_nand_init(mtd, nand, 0))
 +hang();
 +}
 +
 +#ifdef CONFIG_SPL_BUILD
 +void *memcpy(void *dest, const void *src, size_t count)
 +{
 
 CONFIG_SPL_LIBCOMMON_SUPPORT shall give you memcpy.


This does not appear to be the case.  Unless I'm mistaken, memcpy() will be in
either lib/libgeneric.o (lib/string.c) or arch/arm/lib/libarm.o
(arch/arm/lib/memcpy.S) - depending on CONFIG_USE_ARCH_MEMCPY - but in neither
case will it be in common/libcommon.o.


 
 [...]
 
 +void nand_boot(void)
 +{
 [...]
 
 Will the common/spl/ NAND loading code not cut it here? I guess it won't 
 since 
 PXA is FUBAR when it comes to any kind of SPL loading. Do you not want to fix 
 that? I'd be really grateful if you did ;-)


Well, palmtreo680 is a special case because its nand_boot() resumes loading
u-boot where the IPL left off.  IOW, the IPL has already loaded a portion of
u-boot, whereas a generic nand_boot() will want to load the entire image.

I'd be willing to help with pxa spl code, but that might be difficult without
hardware to test on, no?


 
 [...]
 
 btw. you dont really need to #define CONFIG_PXA27X to value 1 in your 
 config, 
 just remove those useless trailing 1s .


Ah yes.  And I'm finding some other clean-ups in the config file.

Thanks again Marek,
Mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 7/8] add support for palm treo 680 board

2013-04-15 Thread Marek Vasut
Dear Mike Dunn,

[...]

  +#ifdef CONFIG_SPL_BUILD
  +void *memcpy(void *dest, const void *src, size_t count)
  +{
  
  CONFIG_SPL_LIBCOMMON_SUPPORT shall give you memcpy.
 
 This does not appear to be the case.  Unless I'm mistaken, memcpy() will be
 in either lib/libgeneric.o (lib/string.c) or arch/arm/lib/libarm.o
 (arch/arm/lib/memcpy.S) - depending on CONFIG_USE_ARCH_MEMCPY - but in
 neither case will it be in common/libcommon.o.

CONFIG_SPL_LIBGENERIC_SUPPORT then ;-)

  [...]
  
  +void nand_boot(void)
  +{
  
  [...]
  
  Will the common/spl/ NAND loading code not cut it here? I guess it won't
  since PXA is FUBAR when it comes to any kind of SPL loading. Do you not
  want to fix that? I'd be really grateful if you did ;-)
 
 Well, palmtreo680 is a special case because its nand_boot() resumes loading
 u-boot where the IPL left off.  IOW, the IPL has already loaded a portion
 of u-boot, whereas a generic nand_boot() will want to load the entire
 image.
 
 I'd be willing to help with pxa spl code, but that might be difficult
 without hardware to test on, no?

Yes, indeed.
[...]
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 7/8] add support for palm treo 680 board

2013-04-15 Thread Mike Dunn
On 04/15/2013 11:33 AM, Marek Vasut wrote:
 Dear Mike Dunn,
 
 [...]
 
 +#ifdef CONFIG_SPL_BUILD
 +void *memcpy(void *dest, const void *src, size_t count)
 +{

 CONFIG_SPL_LIBCOMMON_SUPPORT shall give you memcpy.

 This does not appear to be the case.  Unless I'm mistaken, memcpy() will be
 in either lib/libgeneric.o (lib/string.c) or arch/arm/lib/libarm.o
 (arch/arm/lib/memcpy.S) - depending on CONFIG_USE_ARCH_MEMCPY - but in
 neither case will it be in common/libcommon.o.
 
 CONFIG_SPL_LIBGENERIC_SUPPORT then ;-)


smacks forehead

Does preclude use of CONFIG_USE_ARCH_MEMCPY though.

Thanks,
Mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 7/8] add support for palm treo 680 board

2013-04-14 Thread Marek Vasut
Dear Mike Dunn,

[...]

 +int board_init(void)
 +{
 + /* We have RAM, disable cache */
 + dcache_disable();
 + icache_disable();
 +
 + gd-bd-bi_arch_number = MACH_TYPE_TREO680;

This is not needed, just define CONFIG_MACH_TYPE in treo680.h

 + gd-bd-bi_boot_params = 0xa100;

Is this not CONFIG_SYS_DRAM_BASE + 0x100 ? I think it is.

 +
 + return 0;
 +}
 +
 +int dram_init(void)
 +{
 + /* IPL initializes SDRAM (we're already running from it) */
 + gd-ram_size = PHYS_SDRAM_1_SIZE;
 + return 0;
 +}
 +
 +#ifdef CONFIG_LCD
 +void lcd_enable(void)
 +{
 + /*
 +  * Undo the L_BIAS / gpio77 pin configuration performed by the pxa lcd
 +  * driver code.  We need it as an output gpio.
 +  */
 + writel((readl(GAFR2_L)  ~(0xc  24)), GAFR2_L);
 +
 + /* power-up and enable the lcd */
 + writel(0x0040, GPSR(86)); /* enable; drive high */
 + writel(0x2000, GPSR(77)); /* power; drive high */
 + writel(0x0200, GPCR(25)); /* enable_n; drive low */
 +
 + /* turn on LCD backlight and configure PWM for reasonable brightness */
 + writel(0x00, PWM_CTRL0);
 + writel(0x1b1, PWM_PERVAL0);
 + writel(0xfd, PWM_PWDUTY0);
 + writel(0x0040, GPSR(38)); /*  backlight power on */
 +}
 +#endif
 +
 +#ifdef CONFIG_MMC
 +int board_mmc_init(bd_t *bis)
 +{
 + writel(0x0400, GPSR(42)); /* power on */

Can you not use your bitlibrary for this stuff? Or maybe at least use (1  n) 
here to make it more readable.

But seriously, do you not want to (in the longer run) implement proper GPIO 
driver for PXA? That'd help a lot. Also, do you not want to volunteer to fix 
PXA? I think it's a bit rotting all around ;-)

 + return pxa_mmc_register(0);
 +}
 +#endif
 +
 +void board_nand_init(void)
 +{
 + /* we have one 128M diskonchip G4  */
 +
 + struct mtd_info *mtd = nand_info[0];
 + struct nand_chip *nand = docg4_nand_chip;
 + if (docg4_nand_init(mtd, nand, 0))
 + hang();
 +}
 +
 +#ifdef CONFIG_SPL_BUILD
 +void *memcpy(void *dest, const void *src, size_t count)
 +{

CONFIG_SPL_LIBCOMMON_SUPPORT shall give you memcpy.

[...]

 +void nand_boot(void)
 +{
[...]

Will the common/spl/ NAND loading code not cut it here? I guess it won't since 
PXA is FUBAR when it comes to any kind of SPL loading. Do you not want to fix 
that? I'd be really grateful if you did ;-)

[...]

btw. you dont really need to #define CONFIG_PXA27X to value 1 in your config, 
just remove those useless trailing 1s .
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot