summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2013-05-01 18:05:49 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2013-05-01 18:05:49 +0200
commitf6862963315ecd20c45f71247a39c5cc30730cf6 (patch)
tree7b0e7ac0f511027d54f4235ca2b71c942e953084
parent823edcee3ff3c6a21eb57a2d9ee2cecfda5ef857 (diff)
colibri_t30: emmc: change offset handling
Rather than relying on hard-coded offsets actually make use of partition table parsing implementation. While at it bring the whole config more in-line with the Colibri T20.
-rw-r--r--include/configs/colibri_t30.h88
1 files changed, 50 insertions, 38 deletions
diff --git a/include/configs/colibri_t30.h b/include/configs/colibri_t30.h
index ea6de407d3..4d8d635aa1 100644
--- a/include/configs/colibri_t30.h
+++ b/include/configs/colibri_t30.h
@@ -27,22 +27,15 @@
#include <asm/sizes.h>
+#define CONFIG_COLIBRI_T30 /* Toradex Colibri T30 module */
+
/* High-level configuration options */
#define TEGRA3_SYSMEM "mem=1023M@2048M vmalloc=128M"
#define V_PROMPT "Tegra3 # "
-#define CONFIG_COLIBRI_T30 /* Toradex Colibri T30 module */
-#define CONFIG_TEGRA3_CARDHU
-/* This currently fails environment memory allocation */
-#undef CONFIG_SYS_SKIP_ARM_RELOCATION
-//#define CONFIG_SYS_SKIP_ARM_RELOCATION
-//#define CONFIG_SYS_PLLP_BASE_IS_408MHZ
-
#include "tegra3-common.h"
/* undef the enviroment settings in tegra3-common.h / tegra-common.h */
-#undef CONFIG_ENV_SIZE
#undef CONFIG_LOADADDR
-#undef CONFIG_BOOTDELAY
#undef CONFIG_BOOTARGS
#undef CONFIG_BOOTCOMMAND
#undef CONFIG_DIRECT_BOOTARGS
@@ -62,9 +55,15 @@
#define CONFIG_SYS_BOARD_ODMDATA 0x40080105 /* 1GB, UARTA, etc */
+#define CONFIG_REVISION_TAG 1
+#define CONFIG_SERIAL_TAG 1
+
+#define CONFIG_TRDX_CFG_BLOCK
+
/* PMU */
/* disabled for now #define CONFIG_HW_WATCHDOG */
+#undef CONFIG_BOOTDELAY
#define CONFIG_BOOTDELAY 5
#define CONFIG_NETMASK 255.255.255.0
#undef CONFIG_IPADDR
@@ -72,43 +71,52 @@
#undef CONFIG_SERVERIP
#define CONFIG_SERVERIP 192.168.10.1
-/* ENV */
-#define CONFIG_ENV_SIZE SZ_4K /* env size is a maximum of 4k */
-#define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE
+#undef CONFIG_LINUXCONSOLE /* dynamically adjusted */
-#define CONFIG_NFSBOOTCOMMAND \
- "setenv bootargs ${defargs} ${nfsargs}; " \
+#define DEFAULT_BOOTCOMMAND \
+ "run emmcboot; run usbboot; run nfsboot"
+
+#define NFS_BOOTCMD \
+ "run setup; " \
+ "setenv bootargs ${defargs} ${nfsargs} ${setupargs}; " \
"echo Booting from NFS...; " \
"usb start; " \
"dhcp; " \
- "bootm ${loadaddr} "
+ "bootm"
-#define USB_BOOTCMD \
+#define USB_BOOTCMD \
"setenv bootargs ${defargs} root=/dev/sda3 rw rootwait; " \
- "echo Booting from USB Stick...; " \
- "usb start; " \
- "fatload usb 0:1 ${loadaddr} uimage; " \
- "bootm ${loadaddr} "
-
-#define EMMC_BOOTCMD \
- "setenv bootargs ${defargs} ${mmcargs} ;" \
- "echo Booting from internal eMMC card...; " \
- "mmc read 0 ${loadaddr} ${mmc_kernel_sec}; " \
- "bootm ${loadaddr} "
-
-#define CONFIG_BOOTCOMMAND "run emmcboot; run usbboot; run nfsboot;"
+ "echo Booting from USB Stick...; " \
+ "usb start; " \
+ "fatload usb 0:1 ${loadaddr} uimage; " \
+ "bootm ${loadaddr}"
+
+#define EMMC_BOOTCMD \
+ "run setup; " \
+ "setenv bootargs ${defargs} ${mmcargs} ${setupargs};" \
+ "echo Booting from internal eMMC card...; " \
+ "mmc read 0 ${loadaddr} ${lnxoffset} ${mmc_kernel_size}; " \
+ "bootm ${loadaddr}"
+
+#undef CONFIG_BOOTARGS
+#undef CONFIG_BOOTCOMMAND
+#undef CONFIG_DIRECT_BOOTARGS
+#define CONFIG_BOOTCOMMAND DEFAULT_BOOTCOMMAND
+#define CONFIG_NFSBOOTCOMMAND NFS_BOOTCMD
+//moved from disk/part_efi.h to here, give the block where the GP1 partition starts
+//compare with sdargs below
+#define GPT_PRIMARY_PARTITION_TABLE_LBA (gd->gpt_offset)
#define CONFIG_LOADADDR 0x80408000
-#define CONFIG_ETHADDR 00:0e:c6:87:72:01
#define CONFIG_EXTRA_ENV_SETTINGS \
CONFIG_STD_DEVICES_SETTINGS \
- "board=colibri_t30\0" \
- "defargs=console=ttyS0,115200n8 debug_uartport=lsport lp0_vec=0x00002000@0x9C406000 video=tegrafb mem=1023M@2048M vmalloc=128M noinitrd usbcore.old_scheme_first=1 core_edp_mv=1300 panel=lvds tegraid=30.1.2.0.0 tegra_fbmem=3072K@0xBFE00000 \0" \
+ "defargs=video=tegrafb vmalloc=128M mem=1023M@2048M core_edp_mv=1300 tegra_fbmem=3072K@0xBFE00000 usb_high_speed=1\0" \
"emmcboot=" EMMC_BOOTCMD "\0" \
- "mmcargs=root=/dev/mmcblk0p1 ip=:::::eth0:off rw,noatime rootwait rootfstype=ext3 gpt gpt_sector=40960 \0" \
- "mmc_kernel_sec=0x5000 0x4000 \0" \
+ "mmcargs=ip=off root=/dev/mmcblk0p1 rw,noatime rootfstype=ext3 rootwait\0" \
+ "mmc_kernel_size=0x4000\0" \
"nfsargs=ip=:::::eth0:on root=/dev/nfs rw netdevwait\0" \
- "usbboot=" USB_BOOTCMD "\0"
-
+ "setup=setenv setupargs gpt gpt_sector=${gptoffset} asix_mac=${ethaddr} no_console_suspend=1 console=tty1 console=ttyS0,${baudrate}n8 debug_uartport=lsport,0\0" \
+ "usbboot=" USB_BOOTCMD "\0" \
+ ""
/* GPIO */
#define CONFIG_TEGRA_GPIO
@@ -122,8 +130,9 @@
#define CONFIG_SYS_I2C_SPEED 100000
#define CONFIG_CMD_I2C
-/* PMU */
+/* PMU and EMC support, requires i2c */
#define CONFIG_TEGRA_PMU
+//#define CONFIG_TEGRA_CLOCK_SCALING
/* SD/MMC */
#define CONFIG_MMC
@@ -143,8 +152,9 @@
#endif
#if defined(CONFIG_ENV_IS_IN_MMC)
#define CONFIG_SYS_MMC_ENV_DEV 0 /* use MMC0 */
-#define CONFIG_ENV_OFFSET (16384 * 512) /* Byteaddress of the beginning of the ENV partition */
-#endif
+/* once the eMMC is detected the corresponding setting is taken */
+#define CONFIG_ENV_OFFSET (gd->env_offset * 512)
+#endif /*CONFIG_ENV_IS_IN_MMC */
/* support USB ethernet adapters */
#define CONFIG_USB_HOST_ETHER
@@ -170,4 +180,6 @@
#define CONFIG_DEFAULT_DEVICE_TREE "colibri_t30"
+#define CONFIG_CMD_IMI
+
#endif /* __CONFIG_H */