diff options
Diffstat (limited to 'board/freescale/mx35pdk')
| -rw-r--r-- | board/freescale/mx35pdk/README | 78 | ||||
| -rw-r--r-- | board/freescale/mx35pdk/mx35pdk.c | 27 | 
2 files changed, 28 insertions, 77 deletions
| diff --git a/board/freescale/mx35pdk/README b/board/freescale/mx35pdk/README index 3d69ed583..7232b5335 100644 --- a/board/freescale/mx35pdk/README +++ b/board/freescale/mx35pdk/README @@ -71,91 +71,17 @@ exec -c "noinitrd console=ttymxc0,115200 root=/dev/nfsroot rootfstype=nfsroot nf  Flashing U-Boot  -------------------------------- -There are two options: the original bootloader in NAND can be replaced with -u-boot, or u-boot can be stored on the NOR flash without erasing -the delivered bootloader. +U-boot should be stored on the NOR flash. +  The boot storage can be select using the switches on the personality board  (SW1-SW2) and on the DEBUG board (SW4-SW10). -The second option is to be preferred if you have not a JTAG debugger.  If something goes wrong flashing the bootloader, it is always possible to  recover the board booting from the other device. -Replacing the bootloader on the NAND --------------------------------------- -To replace RedBoot with U-Boot, the easy way is to do this in linux. -Start the kernel with the suggested options. Make sure to have set the -mtdparts exactly as described, because this matches the layout on the -mx35pdk. - -You should see in your boot log the following entries for the NAND -flash: - -5 cmdlinepart partitions found on MTD device mxc_nand -Creating 5 MTD partitions on "mxc_nand": -0x000000000000-0x000000100000 : "boot" -0x000000100000-0x000000600000 : "linux" -0x000000600000-0x000006600000 : "root" -0x000006600000-0x000006e00000 : "cfg" -0x000006e00000-0x000080000000 : "user" - -You can use the utilities flash_eraseall and nandwrite to put -u-boot on the NAND. The bootloader is marked as "boot", and 1MB is -reserved. If everything is correct, this partition is accessed as -/dev/mtd4. However, check if it is correct with "cat /proc/mtd" and -get the device node from the partition name: - -$ cat /proc/mtd | grep boot - -I suggest you try the utilities on a different partition to be sure -if everything works correctly. If not, and you remove RedBoot, you have to -reinstall it using the ATK tool as suggested by Freescale, or using a -JTAG debugger. - -I report the versions of the utilities I used (they are provided with ELDK): - --bash-3.2# nandwrite --version -nandwrite $Revision: 1.32 $ - -flash_eraseall --version -flash_eraseall $Revision: 1.22 $ - -nandwrite reports a warning if the file to be saved is not sector aligned. -This should have no consequences, but I preferred to pad u-boot.bin -to get no problem at all. -$ dd if=/dev/zero of=zeros bs=1 count=74800 -$ cat u-boot.bin zeros > u-boot-padded.bin - -To erase the partition: -$ flash_eraseall /dev/mtd4 - -Writing u-boot: - -$ nandwrite /dev/mtd4 u-boot-padded.bin - -Now U-Boot is stored on the booting partition. - -To boot from NAND, you have to select the switches as follows: - -Personality board -	SW2	1, 4, 5 on -		2, 3, 6, 7, 8 off -	SW1	all off - -Debug Board: -	SW5	0 -	SW6	0 -	SW7	0 -	SW8	1 -	SW9	1 -	SW10	0 - -  Saving U-Boot in the NOR flash  --------------------------------- -The procedure to save in the NOR flash is quite the same as to write into the NAND. -  Check the partition for boot in the NOR flash. Setting the mtdparts as reported,  the boot partition should be /dev/mtd0. diff --git a/board/freescale/mx35pdk/mx35pdk.c b/board/freescale/mx35pdk/mx35pdk.c index bc415b846..7cb6b3086 100644 --- a/board/freescale/mx35pdk/mx35pdk.c +++ b/board/freescale/mx35pdk/mx35pdk.c @@ -32,6 +32,8 @@  #include <i2c.h>  #include <pmic.h>  #include <fsl_pmic.h> +#include <mmc.h> +#include <fsl_esdhc.h>  #include <mc9sdz60.h>  #include <mc13892.h>  #include <linux/types.h> @@ -168,7 +170,7 @@ int board_early_init_f(void)  	/* enable clocks */  	writel(readl(&ccm->cgr0) |  		MXC_CCM_CGR0_EMI_MASK | -		MXC_CCM_CGR0_EDI0_MASK | +		MXC_CCM_CGR0_EDIO_MASK |  		MXC_CCM_CGR0_EPIT1_MASK,  		&ccm->cgr0); @@ -275,3 +277,26 @@ int board_eth_init(bd_t *bis)  	return rc;  } + +#if defined(CONFIG_FSL_ESDHC) + +struct fsl_esdhc_cfg esdhc_cfg = {MMC_SDHC1_BASE_ADDR}; + +int board_mmc_init(bd_t *bis) +{ +	/* configure pins for SDHC1 only */ +	mxc_request_iomux(MX35_PIN_SD1_CMD, MUX_CONFIG_FUNC); +	mxc_request_iomux(MX35_PIN_SD1_CLK, MUX_CONFIG_FUNC); +	mxc_request_iomux(MX35_PIN_SD1_DATA0, MUX_CONFIG_FUNC); +	mxc_request_iomux(MX35_PIN_SD1_DATA1, MUX_CONFIG_FUNC); +	mxc_request_iomux(MX35_PIN_SD1_DATA2, MUX_CONFIG_FUNC); +	mxc_request_iomux(MX35_PIN_SD1_DATA3, MUX_CONFIG_FUNC); + +	return fsl_esdhc_initialize(bis, &esdhc_cfg); +} + +int board_mmc_getcd(struct mmc *mmc) +{ +	return !(mc9sdz60_reg_read(MC9SDZ60_REG_DES_FLAG) & 0x4); +} +#endif |