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