Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Stefano Babic | 99d51c5 | 2017-07-26 18:23:05 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) Stefano Babic <sbabic@denx.de> |
Stefano Babic | 99d51c5 | 2017-07-26 18:23:05 +0200 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | |
| 7 | #ifndef __PCM058_CONFIG_H |
| 8 | #define __PCM058_CONFIG_H |
| 9 | |
Stefano Babic | 99d51c5 | 2017-07-26 18:23:05 +0200 | [diff] [blame] | 10 | #ifdef CONFIG_SPL |
Stefano Babic | 99d51c5 | 2017-07-26 18:23:05 +0200 | [diff] [blame] | 11 | #include "imx6_spl.h" |
| 12 | #endif |
| 13 | |
| 14 | #include "mx6_common.h" |
| 15 | |
| 16 | /* Thermal */ |
| 17 | #define CONFIG_IMX_THERMAL |
| 18 | |
| 19 | /* Serial */ |
| 20 | #define CONFIG_MXC_UART |
| 21 | #define CONFIG_MXC_UART_BASE UART4_BASE |
| 22 | #define CONSOLE_DEV "ttymxc3" |
| 23 | |
| 24 | /* Early setup */ |
Stefano Babic | 99d51c5 | 2017-07-26 18:23:05 +0200 | [diff] [blame] | 25 | |
| 26 | |
| 27 | /* Size of malloc() pool */ |
| 28 | #define CONFIG_SYS_MALLOC_LEN (8 * SZ_1M) |
| 29 | |
| 30 | /* Ethernet */ |
Stefano Babic | 99d51c5 | 2017-07-26 18:23:05 +0200 | [diff] [blame] | 31 | #define IMX_FEC_BASE ENET_BASE_ADDR |
| 32 | #define CONFIG_FEC_XCV_TYPE RGMII |
| 33 | #define CONFIG_ETHPRIME "FEC" |
| 34 | #define CONFIG_FEC_MXC_PHYADDR 3 |
| 35 | |
Stefano Babic | 99d51c5 | 2017-07-26 18:23:05 +0200 | [diff] [blame] | 36 | /* SPI Flash */ |
Stefano Babic | 99d51c5 | 2017-07-26 18:23:05 +0200 | [diff] [blame] | 37 | |
| 38 | /* I2C Configs */ |
| 39 | #define CONFIG_SYS_I2C |
| 40 | #define CONFIG_SYS_I2C_MXC |
| 41 | #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 0 */ |
| 42 | #define CONFIG_SYS_I2C_SPEED 100000 |
| 43 | |
| 44 | #ifndef CONFIG_SPL_BUILD |
| 45 | #define CONFIG_CMD_NAND |
| 46 | /* Enable NAND support */ |
| 47 | #define CONFIG_CMD_NAND_TRIMFFS |
Stefano Babic | 99d51c5 | 2017-07-26 18:23:05 +0200 | [diff] [blame] | 48 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 49 | #define CONFIG_SYS_NAND_BASE 0x40000000 |
| 50 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE |
| 51 | #define CONFIG_SYS_NAND_ONFI_DETECTION |
| 52 | #endif |
| 53 | |
| 54 | /* DMA stuff, needed for GPMI/MXS NAND support */ |
Stefano Babic | 99d51c5 | 2017-07-26 18:23:05 +0200 | [diff] [blame] | 55 | |
| 56 | /* Filesystem support */ |
Stefano Babic | 99d51c5 | 2017-07-26 18:23:05 +0200 | [diff] [blame] | 57 | |
| 58 | /* Various command support */ |
| 59 | |
| 60 | /* Physical Memory Map */ |
Stefano Babic | 99d51c5 | 2017-07-26 18:23:05 +0200 | [diff] [blame] | 61 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 62 | |
| 63 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
| 64 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 65 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 66 | |
| 67 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 68 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 69 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 70 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 71 | |
| 72 | /* MMC Configs */ |
| 73 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 |
| 74 | #define CONFIG_SYS_FSL_USDHC_NUM 2 |
| 75 | |
| 76 | /* Environment organization */ |
Stefano Babic | 99d51c5 | 2017-07-26 18:23:05 +0200 | [diff] [blame] | 77 | |
| 78 | /* Default environment */ |
| 79 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 80 | "addcons=setenv bootargs ${bootargs} " \ |
| 81 | "console=${console},${baudrate}\0" \ |
| 82 | "addip=setenv bootargs ${bootargs} " \ |
| 83 | "ip=${ipaddr}:${serverip}:${gatewayip}:" \ |
| 84 | "${netmask}:${hostname}:${netdev}:off\0" \ |
| 85 | "addmisc=setenv bootargs ${bootargs} ${miscargs}\0" \ |
| 86 | "addmtd=run mtdnand;run mtdspi;" \ |
| 87 | "setenv bootargs ${bootargs} ${mtdparts}\0" \ |
| 88 | "mtdnand=setenv mtdparts mtdparts=gpmi-nand:" \ |
| 89 | "40m(Kernels),400m(root),-(nand)\0" \ |
| 90 | "mtdspi=setenv mtdparts ${mtdparts}" \ |
| 91 | "';spi2.0:1024k(bootloader)," \ |
| 92 | "64k(env1),64k(env2),-(rescue)'\0" \ |
| 93 | "bootcmd=if test -n ${rescue};" \ |
| 94 | "then run swupdate;fi;run nandboot;run swupdate\0" \ |
| 95 | "bootfile=uImage\0" \ |
| 96 | "bootimage=uImage\0" \ |
| 97 | "console=ttymxc3\0" \ |
| 98 | "fdt_addr_r=0x18000000\0" \ |
| 99 | "fdt_file=pfla02.dtb\0" \ |
| 100 | "fdt_high=0xffffffff\0" \ |
| 101 | "initrd_high=0xffffffff\0" \ |
| 102 | "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ |
| 103 | "miscargs=panic=1 quiet\0" \ |
| 104 | "mmcargs=setenv bootargs root=${mmcroot} rw rootwait\0" \ |
| 105 | "mmcboot=if run mmcload;then " \ |
| 106 | "run mmcargs addcons addmisc;" \ |
| 107 | "bootm;fi\0" \ |
| 108 | "mmcload=mmc rescan;" \ |
| 109 | "load mmc 0:${mmcpart} ${kernel_addr_r} boot/fitImage\0"\ |
| 110 | "mmcpart=1\0" \ |
| 111 | "mmcroot=/dev/mmcblk0p1\0" \ |
| 112 | "ubiroot=1\0" \ |
| 113 | "nandargs=setenv bootargs ubi.mtd=1 " \ |
| 114 | "root=ubi0:rootfs${ubiroot} rootfstype=ubifs\0" \ |
| 115 | "nandboot=run mtdnand;ubi part nand0,0;" \ |
| 116 | "ubi readvol ${kernel_addr_r} kernel${ubiroot};" \ |
| 117 | "run nandargs addip addcons addmtd addmisc;" \ |
| 118 | "bootm ${kernel_addr_r}\0" \ |
| 119 | "net_nfs=tftp ${kernel_addr_r} ${board_name}/${bootfile};" \ |
| 120 | "tftp ${fdt_addr_r} ${board_name}/${fdt_file};" \ |
| 121 | "run nfsargs addip addcons addmtd addmisc;" \ |
| 122 | "bootm ${kernel_addr_r} - ${fdt_addr_r}\0" \ |
| 123 | "net_nfs_fit=tftp ${kernel_addr_r} ${board_name}/${fitfile};" \ |
| 124 | "run nfsargs addip addcons addmtd addmisc;" \ |
| 125 | "bootm ${kernel_addr_r}\0" \ |
| 126 | "nfsargs=setenv bootargs root=/dev/nfs" \ |
| 127 | " nfsroot=${serverip}:${nfsroot},v3 panic=1\0" \ |
| 128 | "swupdate=setenv bootargs root=/dev/ram;" \ |
| 129 | "run addip addcons addmtd addmisc;" \ |
| 130 | "sf probe;" \ |
| 131 | "sf read ${kernel_addr_r} 120000 600000;" \ |
| 132 | "sf read 14000000 730000 800000;" \ |
| 133 | "bootm ${kernel_addr_r} 14000000\0" |
| 134 | |
| 135 | #endif |