X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=blobdiff_plain;f=include%2Fconfigs%2Ftx48.h;h=0281d2530de0852753d1a17dcf122e2b1e75969a;hp=0285f8373f9a3e5c4b6263b72bd70d0d1348f2cb;hb=cce4dee35eced4de9217a21bb7a6055205d759d6;hpb=1c2a0ed54897ad24e92a5319dc819b4937440b34 diff --git a/include/configs/tx48.h b/include/configs/tx48.h index 0285f8373f..0281d2530d 100644 --- a/include/configs/tx48.h +++ b/include/configs/tx48.h @@ -1,32 +1,29 @@ /* * tx48.h * - * Copyright (C) 2012 Lothar Waßmann + * Copyright (C) 2012-2014 Lothar Waßmann * * based on: am335x_evm * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation version 2. + * SPDX-License-Identifier: GPL-2.0 * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ -#ifndef __CONFIGS_TX48_H -#define __CONFIGS_TX48_H +#ifndef __CONFIG_H +#define __CONFIG_H + +#define CONFIG_AM33XX /* must be set before including omap.h */ #include +#include /* * Ka-Ro TX48 board - SoC configuration */ -#define CONFIG_AM33XX +#define CONFIG_OMAP #define CONFIG_AM33XX_GPIO -#define CONFIG_SYS_HZ 1000 /* Ticks per second */ +#define CONFIG_SYS_HZ 1000 /* Ticks per second */ #ifndef CONFIG_SPL_BUILD #define CONFIG_SKIP_LOWLEVEL_INIT @@ -74,11 +71,11 @@ */ #define CONFIG_SYS_LONGHELP #define CONFIG_SYS_PROMPT "TX48 U-Boot > " -#define CONFIG_SYS_CBSIZE 2048 /* Console I/O buffer size */ +#define CONFIG_SYS_CBSIZE 2048 /* Console I/O buffer size */ #define CONFIG_SYS_PBSIZE \ (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) /* Print buffer size */ -#define CONFIG_SYS_MAXARGS 64 /* Max number of command args */ +#define CONFIG_SYS_MAXARGS 256 /* Max number of command args */ #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot argument buffer size */ #define CONFIG_VERSION_VARIABLE /* U-BOOT version */ @@ -91,26 +88,14 @@ /* * Flattened Device Tree (FDT) support */ -#ifdef CONFIG_OF_LIBFDT /* set via cmdline parameter thru boards.cfg */ -#define CONFIG_FDT_FIXUP_PARTITIONS -#define CONFIG_OF_EMBED +#define CONFIG_OF_LIBFDT #define CONFIG_OF_BOARD_SETUP -#define CONFIG_DEFAULT_DEVICE_TREE tx48 -#define CONFIG_ARCH_DEVICE_TREE am33xx -#define CONFIG_MACH_TYPE (-1) -#define CONFIG_SYS_FDT_ADDR (PHYS_SDRAM_1 + SZ_16M) -#else -#ifndef MACH_TYPE_TIAM335EVM -#define MACH_TYPE_TIAM335EVM 3589 /* Until the next sync */ -#endif -#define CONFIG_MACH_TYPE MACH_TYPE_TIAM335EVM -#endif /* * Boot Linux */ -#define xstr(s) str(s) -#define str(s) #s +#define xstr(s) str(s) +#define str(s) #s #define __pfx(x, s) (x##s) #define _pfx(x, s) __pfx(x, s) @@ -120,56 +105,58 @@ #define CONFIG_ZERO_BOOTDELAY_CHECK #define CONFIG_SYS_AUTOLOAD "no" #define CONFIG_BOOTFILE "uImage" -#define CONFIG_BOOTARGS "console=ttyO0,115200 ro debug panic=1" -#define CONFIG_BOOTCOMMAND "run bootcmd_nand" +#define CONFIG_BOOTARGS "init=/linuxrc console=ttyO0,115200 ro debug panic=1" +#define CONFIG_BOOTCOMMAND "run bootcmd_${boot_mode} bootm_cmd" #define CONFIG_LOADADDR 83000000 +#define CONFIG_FDTADDR 81000000 #define CONFIG_SYS_LOAD_ADDR _pfx(0x, CONFIG_LOADADDR) +#define CONFIG_SYS_FDT_ADDR _pfx(0x, CONFIG_FDTADDR) #define CONFIG_U_BOOT_IMG_SIZE SZ_1M #define CONFIG_HW_WATCHDOG /* - * Extra Environments + * Extra Environment Settings */ -#ifdef CONFIG_OF_LIBFDT -#define TX48_BOOTM_CMD \ - "bootm_cmd=fdt boardsetup;bootm ${loadaddr} - ${fdtaddr}\0" -#define TX48_MTDPARTS_CMD "" -#else -#define TX48_BOOTM_CMD \ - "bootm_cmd=bootm\0" -#define TX48_MTDPARTS_CMD " ${mtdparts}" -#endif +#define CONFIG_SYS_CPU_CLK_STR xstr(CONFIG_SYS_MPU_CLK) #define CONFIG_EXTRA_ENV_SETTINGS \ "autostart=no\0" \ "baseboard=stk5-v3\0" \ + "bootargs_jffs2=run default_bootargs;set bootargs ${bootargs}" \ + " root=/dev/mtdblock4 rootfstype=jffs2\0" \ "bootargs_mmc=run default_bootargs;set bootargs ${bootargs}" \ " root=/dev/mmcblk0p2 rootwait\0" \ - "bootargs_nand=run default_bootargs;set bootargs ${bootargs}" \ - " root=/dev/mtdblock4 rootfstype=jffs2\0" \ - "nfsroot=/tftpboot/rootfs\0" \ "bootargs_nfs=run default_bootargs;set bootargs ${bootargs}" \ - " root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},nolock\0"\ - "bootcmd_mmc=set autostart no;run bootargs_mmc;" \ - " fatload mmc 0 ${loadaddr} uImage;run bootm_cmd\0" \ - "bootcmd_nand=set autostart no;run bootargs_nand;" \ - " nboot linux;run bootm_cmd\0" \ - "bootcmd_net=set autostart no;run bootargs_nfs;dhcp;" \ - " run bootm_cmd\0" \ - TX48_BOOTM_CMD \ + " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock" \ + " ip=dhcp\0" \ + "bootargs_ubifs=run default_bootargs;set bootargs ${bootargs}" \ + " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs\0" \ + "bootcmd_jffs2=set autostart no;run bootargs_jffs2" \ + ";nboot linux\0" \ + "bootcmd_mmc=set autostart no;run bootargs_mmc" \ + ";fatload mmc 0 ${loadaddr} uImage\0" \ + "bootcmd_nand=set autostart no;run bootargs_ubifs" \ + ";nboot linux\0" \ + "bootcmd_net=set autoload y;set autostart n;run bootargs_nfs" \ + ";dhcp\0" \ + "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0" \ + "boot_mode=nand\0" \ + "cpu_clk=" CONFIG_SYS_CPU_CLK_STR "\0" \ "default_bootargs=set bootargs " CONFIG_BOOTARGS \ - TX48_MTDPARTS_CMD \ - " video=${video_mode} ${append_bootargs}\0" \ - "cpu_clk=" xstr(CONFIG_SYS_MPU_CLK) "\0" \ - "fdtaddr=81000000\0" \ + " ${append_bootargs}\0" \ + "fdtaddr=" xstr(CONFIG_FDTADDR) "\0" \ + "fdtsave=fdt resize;nand erase.part dtb" \ + ";nand write ${fdtaddr} dtb ${fdtsize}\0" \ "mtdids=" MTDIDS_DEFAULT "\0" \ "mtdparts=" MTDPARTS_DEFAULT "\0" \ + "nfsroot=/tftpboot/rootfs\0" \ "otg_mode=device\0" \ "touchpanel=tsc2007\0" \ - "video_mode=640x480MR-24@60\0" + "video_mode=VGA\0" #define MTD_NAME "omap2-nand.0" #define MTDIDS_DEFAULT "nand0=" MTD_NAME +#define CONFIG_FDT_FIXUP_PARTITIONS /* * U-Boot Commands @@ -181,6 +168,7 @@ #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_BOOTCE #define CONFIG_CMD_TIME +#define CONFIG_CMD_MEMTEST /* * Serial Driver @@ -228,7 +216,10 @@ #ifdef CONFIG_CMD_NAND #define CONFIG_MTD_DEVICE #define CONFIG_ENV_IS_IN_NAND -#define CONFIG_NAND_AM33XX +#define CONFIG_NAND_OMAP_GPMC +#ifndef CONFIG_SPL_BUILD +#define CONFIG_SYS_GPMC_PREFETCH_ENABLE +#endif #define GPMC_NAND_ECC_LP_x8_LAYOUT #define GPMC_NAND_HW_ECC_LAYOUT_KERNEL GPMC_NAND_HW_ECC_LAYOUT #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x20000 @@ -248,7 +239,8 @@ #define CONFIG_ENV_SIZE SZ_128K #define CONFIG_ENV_RANGE 0x60000 #endif /* CONFIG_ENV_IS_IN_NAND */ -#define CONFIG_SYS_NAND_BASE 0x08000000 /* must be defined but value is irrelevant */ +#define CONFIG_SYS_NAND_BASE 0x00100000 +#define CONFIG_SYS_NAND_SIZE SZ_128M #define NAND_BASE CONFIG_SYS_NAND_BASE #endif /* CONFIG_CMD_NAND */ @@ -266,6 +258,7 @@ #define CONFIG_DOS_PARTITION #define CONFIG_CMD_FAT +#define CONFIG_FAT_WRITE #define CONFIG_CMD_EXT2 /* @@ -288,13 +281,13 @@ xstr(CONFIG_ENV_RANGE) \ "(env)," \ xstr(CONFIG_ENV_RANGE) \ - "(env2),4m(linux),16m(rootfs),256k(dtb),107904k(userfs),512k@0x7f80000(bbt)ro" + "(env2),6m(linux),32m(rootfs),89216k(userfs),512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro" #else #define MTDPARTS_DEFAULT "mtdparts=" MTD_NAME ":" \ "128k(u-boot-spl)," \ "1m(u-boot)," \ xstr(CONFIG_ENV_RANGE) \ - "(env),4m(linux),16m(rootfs),256k(dtb),108288k(userfs),512k@0x7f80000(bbt)ro" + "(env),6m(linux),32m(rootfs),89600k(userfs),512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro" #endif #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 @@ -310,13 +303,14 @@ /* Defines for SPL */ #define CONFIG_SPL #define CONFIG_SPL_FRAMEWORK -#define CONFIG_SPL_BOARD_INIT -#define CONFIG_SPL_MAX_SIZE (46 * SZ_1K) +#define CONFIG_SPL_MAX_SIZE (SRAM_SCRATCH_SPACE_ADDR - CONFIG_SPL_TEXT_BASE) #define CONFIG_SPL_GPIO_SUPPORT -#ifdef CONFIG_NAND_AM33XX +#ifdef CONFIG_NAND_OMAP_GPMC +#define CONFIG_SPL_NAND_SUPPORT #define CONFIG_SPL_NAND_DRIVERS +#define CONFIG_SPL_NAND_BASE +#define CONFIG_SPL_NAND_ECC #define CONFIG_SPL_NAND_AM33XX_BCH -#define CONFIG_SPL_NAND_SUPPORT #define CONFIG_SYS_NAND_5_ADDR_CYCLE #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \ CONFIG_SYS_NAND_PAGE_SIZE) @@ -351,4 +345,4 @@ #define CONFIG_SYS_SPL_MALLOC_START (PHYS_SDRAM_1 + SZ_2M + SZ_32K) #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_1M -#endif /* __CONFIGS_TX48_H */ +#endif /* __CONFIG_H */