[U-Boot] problem to boot i.MX28 custom platform

Greetings,
I'm porting a custom platform based on mx28evk to latest U-Boot. I modified the iomux.c for my platform (different DUART pins) and made some changes to mxs_adjust_memory_params() to accommodate to my DRAM chip.
I built the u-boot.sb. The platform however does not boot either from USB or from MMC. When loaded through USB, sb_loader complains with the messages at [1]. I fear the CPU resets before even executing the SPL code, but how could I tell? Is there a way to check if the CPU reaches this code at all? I don't see any ROM error codes either and the CPU seems to reset (when the USB recovery mode fails, the target defaults to boot from flash my old v2009 U-Boot). Is there any other init stuff (linker scripts or something) I should take care of that's preventing sb_loader to fully load the image?
Thank you.
[1] sb_loader output
'Freescale,Inc.' 'ROM Recovery' device at USB path 0002:0034:00 Downloading 415504 bytes... hid_write report id 01 len 0x1f
hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 ERROR: hid_write() returned -1 (error (null))

Hi Hector,
On Tue, Feb 26, 2013 at 9:19 AM, Hector Palacios hector.palacios@digi.com wrote:
Greetings,
I'm porting a custom platform based on mx28evk to latest U-Boot. I modified the iomux.c for my platform (different DUART pins) and made some changes to mxs_adjust_memory_params() to accommodate to my DRAM chip.
I built the u-boot.sb. The platform however does not boot either from USB or from MMC.
Please try booting from NAND as per the instructions from: doc/README.mx28_common
When loaded through USB, sb_loader complains with the messages at [1]. I fear the CPU resets before even executing the SPL code, but how could I tell? Is there a way to check if the CPU reaches this code at all? I don't see any ROM error codes either and the CPU seems to reset (when the USB recovery mode fails, the target defaults to boot from flash my old v2009 U-Boot). Is there any other init stuff (linker scripts or something) I should take care of that's preventing sb_loader to fully load the image?
Do you have a diff of your bootlets changes from your FSL U-boot? Then make sure these changes are incorporated into U-boot.
Or maybe post RFC patches for your board addition into the mailing list, so that people can comment.

On 02/26/2013 01:19 PM, Hector Palacios wrote:
Greetings,
I'm porting a custom platform based on mx28evk to latest U-Boot. I modified the iomux.c for my platform (different DUART pins) and made some changes to mxs_adjust_memory_params() to accommodate to my DRAM chip.
I built the u-boot.sb. The platform however does not boot either from USB or from MMC. When loaded through USB, sb_loader complains with the messages at [1]. I fear the CPU resets before even executing the SPL code, but how could I tell? Is there a way to check if the CPU reaches this code at all? I don't see any ROM error codes either and the CPU seems to reset (when the USB recovery mode fails, the target defaults to boot from flash my old v2009 U-Boot). Is there any other init stuff (linker scripts or something) I should take care of that's preventing sb_loader to fully load the image?
Thank you.
[1] sb_loader output
'Freescale,Inc.' 'ROM Recovery' device at USB path 0002:0034:00 Downloading 415504 bytes... hid_write report id 01 len 0x1f
hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 . hid_write report id 02 len 0x400 ERROR: hid_write() returned -1 (error (null))
Apparently the problem was due to my platform suffering a hardware specific VDDD brownout during the initialization.
Just in case it helps anybody, the reason why I was not able to see anything on the DUART port during SPL initialization, despite having enabled CONFIG_SPL_SERIAL_SUPPORT and having serial_puts() on the SPL code, was that my platform uses alternate pins for the DUART than the default used by the BOOT ROM and the EVK, so apart from configuring the correct IOMUX, I needed to unconfigure the pins used by BOOT ROM for the DUART (on board/<vendor>/iomux.c):
@@ -33,8 +33,12 @@
const iomux_cfg_t iomux_setup[] = { /* DUART */ - MX28_PAD_PWM0__DUART_RX, - MX28_PAD_PWM1__DUART_TX, + /* Unconfigure BOOT ROM default DUART */ + MX28_PAD_PWM0__GPIO_3_16, + MX28_PAD_PWM1__GPIO_3_17, + /* Configure DUART on alternate pins */ + MX28_PAD_I2C0_SCL__DUART_RX, + MX28_PAD_I2C0_SDA__DUART_TX,
/* MMC0 */ MX28_PAD_SSP0_DATA0__SSP0_D0 | MUX_CONFIG_SSP0, @@ -159,9 +163,6 @@ const iomux_cfg_t iomux_setup[] = { MX28_PAD_SSP2_MISO__SSP2_D0 | MUX_CONFIG_SSP2, MX28_PAD_SSP2_SS0__SSP2_D3 | (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP), - /* I2C */ - MX28_PAD_I2C0_SCL__I2C0_SCL, - MX28_PAD_I2C0_SDA__I2C0_SDA, };
#define HW_DRAM_CTL29 (0x74 >> 2)

Hi Hector,
Hector Palacios wrote:
Apparently the problem was due to my platform suffering a hardware specific VDDD brownout during the initialization.
Just in case it helps anybody, the reason why I was not able to see anything on the DUART port during SPL initialization, despite having enabled CONFIG_SPL_SERIAL_SUPPORT and having serial_puts() on the SPL code, was that my platform uses alternate pins for the DUART than the default used by the BOOT ROM and the EVK, so apart from configuring the correct IOMUX, I needed to unconfigure the pins used by BOOT ROM for the DUART (on board/<vendor>/iomux.c):
@@ -33,8 +33,12 @@
const iomux_cfg_t iomux_setup[] = { /* DUART */
MX28_PAD_PWM0__DUART_RX,
MX28_PAD_PWM1__DUART_TX,
/* Unconfigure BOOT ROM default DUART */
MX28_PAD_PWM0__GPIO_3_16,
MX28_PAD_PWM1__GPIO_3_17,
/* Configure DUART on alternate pins */
MX28_PAD_I2C0_SCL__DUART_RX,
MX28_PAD_I2C0_SDA__DUART_TX, /* MMC0 */ MX28_PAD_SSP0_DATA0__SSP0_D0 | MUX_CONFIG_SSP0,
@@ -159,9 +163,6 @@ const iomux_cfg_t iomux_setup[] = { MX28_PAD_SSP2_MISO__SSP2_D0 | MUX_CONFIG_SSP2, MX28_PAD_SSP2_SS0__SSP2_D3 | (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP),
/* I2C */
MX28_PAD_I2C0_SCL__I2C0_SCL,
MX28_PAD_I2C0_SDA__I2C0_SDA,
};
#define HW_DRAM_CTL29 (0x74 >> 2)
Thanks for sharing your solution. It seems that the other mx28 boards we currently have all use MX28_PAD_PWM0__DUART_RX / MX28_PAD_PWM1__DUART_TX for DUART and then we never faced this issue.
It would be great if you can submit a patch for adding support to your board in U-boot.
Regards,
Fabio Estevam
participants (3)
-
Fabio Estevam
-
Fabio Estevam
-
Hector Palacios