Re: [U-Boot] [PATCH] powerpc: Add cpu_late_init_r to allow for initialization post env setup

2011-02-02 Thread Kumar Gala

On Feb 2, 2011, at 11:53 AM, Haiying Wang wrote:

> On Wed, 2011-02-02 at 11:27 -0600, Kumar Gala wrote:
>> +void cpu_late_init_r(void)
>> +{
>> +#ifdef CONFIG_QE
>> +uint qe_base = CONFIG_SYS_IMMR + 0x0008; /* QE immr base */
>> +qe_init(qe_base);
>> +qe_reset();
>> +#endif
>> +}
> You did not move qe_reset() inside qe_init() as you recommended.:)

Yeah, forgot about that.  Part of this was to see what response the patch got 
(ie is this even acceptable).

> For NAND boot case, the microcode needs to be read from nand flash via
> nand_read first, so you might add some more code like:
> +void cpu_late_init_r(void)
> +{
> +#ifdef CONFIG_QE
> +#ifdef CONFIG_SYS_QE_FW_IN_NAND
> +  int ret;
> +  size_t fw_length = CONFIG_SYS_QE_FW_LENGTH;
> 
> +  /* load QE firmware from NAND flash to DDR first */
> +   ret = nand_read(&nand_info[0],(loff_t)CONFIG_SYS_QE_FW_IN_NAND,
> +   &fw_length, (u_char *)CONFIG_SYS_QE_FW_ADDR);
> 
> +   if (ret && ret == -EUCLEAN) {
> +  printf ("NAND read for QE firmware at offset %x failed %
> d\n",
> +   CONFIG_SYS_QE_FW_IN_NAND, ret);
> +   }
> +#endif
> + uint qe_base = CONFIG_SYS_IMMR + 0x0008; /* QE immr base */
> + qe_init(qe_base);
> + qe_reset();
> +#endif
> +}
> 
> Haiying

I leave that to you when we add a board (like P1021 MDS) that needs boot from 
NAND.

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


Re: [U-Boot] [PATCH] powerpc: Add cpu_late_init_r to allow for initialization post env setup

2011-02-02 Thread Haiying Wang
On Wed, 2011-02-02 at 11:27 -0600, Kumar Gala wrote:
> +void cpu_late_init_r(void)
> +{
> +#ifdef CONFIG_QE
> + uint qe_base = CONFIG_SYS_IMMR + 0x0008; /* QE immr base */
> + qe_init(qe_base);
> + qe_reset();
> +#endif
> +}
You did not move qe_reset() inside qe_init() as you recommended.:)

For NAND boot case, the microcode needs to be read from nand flash via
nand_read first, so you might add some more code like:
+void cpu_late_init_r(void)
 +{
 +#ifdef CONFIG_QE
 +#ifdef CONFIG_SYS_QE_FW_IN_NAND
 +  int ret;
 +  size_t fw_length = CONFIG_SYS_QE_FW_LENGTH;

 +  /* load QE firmware from NAND flash to DDR first */
 +   ret = nand_read(&nand_info[0],(loff_t)CONFIG_SYS_QE_FW_IN_NAND,
 +   &fw_length, (u_char *)CONFIG_SYS_QE_FW_ADDR);

 +   if (ret && ret == -EUCLEAN) {
 +  printf ("NAND read for QE firmware at offset %x failed %
d\n",
 +   CONFIG_SYS_QE_FW_IN_NAND, ret);
 +   }
 +#endif
 +  uint qe_base = CONFIG_SYS_IMMR + 0x0008; /* QE immr base */
 +  qe_init(qe_base);
 +  qe_reset();
 +#endif
 +}

Haiying



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