1*a373024eSAngelo Dureghello /* 2*a373024eSAngelo Dureghello * Sysam stmark2 board configuration 3*a373024eSAngelo Dureghello * 4*a373024eSAngelo Dureghello * (C) Copyright 2017 Angelo Dureghello <angelo@sysam.it> 5*a373024eSAngelo Dureghello * 6*a373024eSAngelo Dureghello * SPDX-License-Identifier: GPL-2.0+ 7*a373024eSAngelo Dureghello */ 8*a373024eSAngelo Dureghello 9*a373024eSAngelo Dureghello #ifndef __STMARK2_CONFIG_H 10*a373024eSAngelo Dureghello #define __STMARK2_CONFIG_H 11*a373024eSAngelo Dureghello 12*a373024eSAngelo Dureghello #define CONFIG_STMARK2 13*a373024eSAngelo Dureghello #define CONFIG_HOSTNAME stmark2 14*a373024eSAngelo Dureghello 15*a373024eSAngelo Dureghello #define CONFIG_MCFUART 16*a373024eSAngelo Dureghello #define CONFIG_SYS_UART_PORT 0 17*a373024eSAngelo Dureghello #define CONFIG_SYS_BAUDRATE_TABLE { 9600 , 19200 , 38400 , 57600, 115200 } 18*a373024eSAngelo Dureghello 19*a373024eSAngelo Dureghello #define LDS_BOARD_TEXT \ 20*a373024eSAngelo Dureghello board/sysam/stmark2/sbf_dram_init.o (.text*) 21*a373024eSAngelo Dureghello 22*a373024eSAngelo Dureghello #define CONFIG_TIMESTAMP 23*a373024eSAngelo Dureghello 24*a373024eSAngelo Dureghello #define CONFIG_BOOTARGS \ 25*a373024eSAngelo Dureghello "console=ttyS0,115200 root=/dev/ram0 rw " \ 26*a373024eSAngelo Dureghello "rootfstype=ramfs " \ 27*a373024eSAngelo Dureghello "rdinit=/bin/init " \ 28*a373024eSAngelo Dureghello "devtmpfs.mount=1" 29*a373024eSAngelo Dureghello 30*a373024eSAngelo Dureghello #define CONFIG_BOOTCOMMAND \ 31*a373024eSAngelo Dureghello "sf probe 0:1 50000000; " \ 32*a373024eSAngelo Dureghello "sf read ${loadaddr} 0x100000 ${kern_size}; " \ 33*a373024eSAngelo Dureghello "bootm ${loadaddr}" 34*a373024eSAngelo Dureghello 35*a373024eSAngelo Dureghello #define CONFIG_EXTRA_ENV_SETTINGS \ 36*a373024eSAngelo Dureghello "kern_size=0x700000\0" \ 37*a373024eSAngelo Dureghello "loadaddr=0x40001000\0" \ 38*a373024eSAngelo Dureghello "-(rootfs)\0" \ 39*a373024eSAngelo Dureghello "update_uboot=loady ${loadaddr}; " \ 40*a373024eSAngelo Dureghello "sf probe 0:1 50000000; " \ 41*a373024eSAngelo Dureghello "sf erase 0 0x80000; " \ 42*a373024eSAngelo Dureghello "sf write ${loadaddr} 0 ${filesize}\0" \ 43*a373024eSAngelo Dureghello "update_kernel=loady ${loadaddr}; " \ 44*a373024eSAngelo Dureghello "setenv kern_size ${filesize}; saveenv; " \ 45*a373024eSAngelo Dureghello "sf probe 0:1 50000000; " \ 46*a373024eSAngelo Dureghello "sf erase 0x100000 0x700000; " \ 47*a373024eSAngelo Dureghello "sf write ${loadaddr} 0x100000 ${filesize}\0" \ 48*a373024eSAngelo Dureghello "update_rootfs=loady ${loadaddr}; " \ 49*a373024eSAngelo Dureghello "sf probe 0:1 50000000; " \ 50*a373024eSAngelo Dureghello "sf erase 0x00800000 0x100000; " \ 51*a373024eSAngelo Dureghello "sf write ${loadaddr} 0x00800000 ${filesize}\0" \ 52*a373024eSAngelo Dureghello "" 53*a373024eSAngelo Dureghello 54*a373024eSAngelo Dureghello /* Realtime clock */ 55*a373024eSAngelo Dureghello #undef CONFIG_MCFRTC 56*a373024eSAngelo Dureghello #define CONFIG_RTC_MCFRRTC 57*a373024eSAngelo Dureghello #define CONFIG_SYS_MCFRRTC_BASE 0xFC0A8000 58*a373024eSAngelo Dureghello 59*a373024eSAngelo Dureghello /* spi not partitions */ 60*a373024eSAngelo Dureghello #define CONFIG_CMD_MTDPARTS 61*a373024eSAngelo Dureghello #define CONFIG_MTD_DEVICE 62*a373024eSAngelo Dureghello #define CONFIG_JFFS2_CMDLINE 63*a373024eSAngelo Dureghello #define CONFIG_JFFS2_DEV "nor0" 64*a373024eSAngelo Dureghello #define MTDIDS_DEFAULT "nor0=spi-flash.0" 65*a373024eSAngelo Dureghello #define MTDPARTS_DEFAULT \ 66*a373024eSAngelo Dureghello "mtdparts=spi-flash.0:" \ 67*a373024eSAngelo Dureghello "1m(u-boot)," \ 68*a373024eSAngelo Dureghello "7m(kernel)," \ 69*a373024eSAngelo Dureghello "-(rootfs)" 70*a373024eSAngelo Dureghello 71*a373024eSAngelo Dureghello /* Timer */ 72*a373024eSAngelo Dureghello #define CONFIG_MCFTMR 73*a373024eSAngelo Dureghello #undef CONFIG_MCFPIT 74*a373024eSAngelo Dureghello 75*a373024eSAngelo Dureghello /* DSPI and Serial Flash */ 76*a373024eSAngelo Dureghello #define CONFIG_CF_SPI 77*a373024eSAngelo Dureghello #define CONFIG_CF_DSPI 78*a373024eSAngelo Dureghello #define CONFIG_SF_DEFAULT_SPEED 50000000 79*a373024eSAngelo Dureghello #define CONFIG_SERIAL_FLASH 80*a373024eSAngelo Dureghello #define CONFIG_HARD_SPI 81*a373024eSAngelo Dureghello #define CONFIG_SPI_FLASH_ISSI 82*a373024eSAngelo Dureghello #define CONFIG_ENV_SPI_BUS 0 83*a373024eSAngelo Dureghello #define CONFIG_ENV_SPI_CS 1 84*a373024eSAngelo Dureghello 85*a373024eSAngelo Dureghello #define CONFIG_SYS_SBFHDR_SIZE 0x7 86*a373024eSAngelo Dureghello 87*a373024eSAngelo Dureghello #define CONFIG_SYS_DSPI_CTAR0 (DSPI_CTAR_TRSZ(7) | \ 88*a373024eSAngelo Dureghello DSPI_CTAR_PCSSCK_1CLK | \ 89*a373024eSAngelo Dureghello DSPI_CTAR_PASC(0) | \ 90*a373024eSAngelo Dureghello DSPI_CTAR_PDT(0) | \ 91*a373024eSAngelo Dureghello DSPI_CTAR_CSSCK(0) | \ 92*a373024eSAngelo Dureghello DSPI_CTAR_ASC(0) | \ 93*a373024eSAngelo Dureghello DSPI_CTAR_DT(1) | \ 94*a373024eSAngelo Dureghello DSPI_CTAR_BR(6)) 95*a373024eSAngelo Dureghello #define CONFIG_SYS_DSPI_CTAR1 (CONFIG_SYS_DSPI_CTAR0) 96*a373024eSAngelo Dureghello #define CONFIG_SYS_DSPI_CTAR2 (CONFIG_SYS_DSPI_CTAR0) 97*a373024eSAngelo Dureghello 98*a373024eSAngelo Dureghello /* Input, PCI, Flexbus, and VCO */ 99*a373024eSAngelo Dureghello #define CONFIG_EXTRA_CLOCK 100*a373024eSAngelo Dureghello 101*a373024eSAngelo Dureghello #define CONFIG_PRAM 2048 /* 2048 KB */ 102*a373024eSAngelo Dureghello #define CONFIG_SYS_LONGHELP 103*a373024eSAngelo Dureghello #define CONFIG_AUTO_COMPLETE 104*a373024eSAngelo Dureghello #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ 105*a373024eSAngelo Dureghello 106*a373024eSAngelo Dureghello /* Print Buffer Size */ 107*a373024eSAngelo Dureghello #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ 108*a373024eSAngelo Dureghello sizeof(CONFIG_SYS_PROMPT) + 16) 109*a373024eSAngelo Dureghello #define CONFIG_SYS_MAXARGS 16 110*a373024eSAngelo Dureghello /* Boot Argument Buffer Size */ 111*a373024eSAngelo Dureghello #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE 112*a373024eSAngelo Dureghello 113*a373024eSAngelo Dureghello #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x10000) 114*a373024eSAngelo Dureghello #define CONFIG_SYS_MBAR 0xFC000000 115*a373024eSAngelo Dureghello 116*a373024eSAngelo Dureghello /* 117*a373024eSAngelo Dureghello * Definitions for initial stack pointer and data area (in internal SRAM) 118*a373024eSAngelo Dureghello */ 119*a373024eSAngelo Dureghello #define CONFIG_SYS_INIT_RAM_ADDR 0x80000000 120*a373024eSAngelo Dureghello /* End of used area in internal SRAM */ 121*a373024eSAngelo Dureghello #define CONFIG_SYS_INIT_RAM_SIZE 0x10000 122*a373024eSAngelo Dureghello #define CONFIG_SYS_INIT_RAM_CTRL 0x221 123*a373024eSAngelo Dureghello #define CONFIG_SYS_GBL_DATA_OFFSET ((CONFIG_SYS_INIT_RAM_SIZE - \ 124*a373024eSAngelo Dureghello GENERATED_GBL_DATA_SIZE) - 32) 125*a373024eSAngelo Dureghello #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET 126*a373024eSAngelo Dureghello #define CONFIG_SYS_SBFHDR_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - 32) 127*a373024eSAngelo Dureghello 128*a373024eSAngelo Dureghello /* 129*a373024eSAngelo Dureghello * Start addresses for the final memory configuration 130*a373024eSAngelo Dureghello * (Set up by the startup code) 131*a373024eSAngelo Dureghello * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0 132*a373024eSAngelo Dureghello */ 133*a373024eSAngelo Dureghello #define CONFIG_SYS_SDRAM_BASE 0x40000000 134*a373024eSAngelo Dureghello #define CONFIG_SYS_SDRAM_SIZE 128 /* SDRAM size in MB */ 135*a373024eSAngelo Dureghello 136*a373024eSAngelo Dureghello #define CONFIG_SYS_MEMTEST_START (CONFIG_SYS_SDRAM_BASE + 0x400) 137*a373024eSAngelo Dureghello #define CONFIG_SYS_MEMTEST_END ((CONFIG_SYS_SDRAM_SIZE - 3) << 20) 138*a373024eSAngelo Dureghello #define CONFIG_SYS_DRAM_TEST 139*a373024eSAngelo Dureghello 140*a373024eSAngelo Dureghello #if defined(CONFIG_CF_SBF) 141*a373024eSAngelo Dureghello #define CONFIG_SERIAL_BOOT 142*a373024eSAngelo Dureghello #endif 143*a373024eSAngelo Dureghello 144*a373024eSAngelo Dureghello #if defined(CONFIG_SERIAL_BOOT) 145*a373024eSAngelo Dureghello #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_TEXT_BASE + 0x400) 146*a373024eSAngelo Dureghello #else 147*a373024eSAngelo Dureghello #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_FLASH_BASE + 0x400) 148*a373024eSAngelo Dureghello #endif 149*a373024eSAngelo Dureghello 150*a373024eSAngelo Dureghello #define CONFIG_SYS_BOOTPARAMS_LEN (64 * 1024) 151*a373024eSAngelo Dureghello /* Reserve 256 kB for Monitor */ 152*a373024eSAngelo Dureghello #define CONFIG_SYS_MONITOR_LEN (256 << 10) 153*a373024eSAngelo Dureghello /* Reserve 256 kB for malloc() */ 154*a373024eSAngelo Dureghello #define CONFIG_SYS_MALLOC_LEN (256 << 10) 155*a373024eSAngelo Dureghello 156*a373024eSAngelo Dureghello /* 157*a373024eSAngelo Dureghello * For booting Linux, the board info and command line data 158*a373024eSAngelo Dureghello * have to be in the first 8 MB of memory, since this is 159*a373024eSAngelo Dureghello * the maximum mapped by the Linux kernel during initialization ?? 160*a373024eSAngelo Dureghello */ 161*a373024eSAngelo Dureghello /* Initial Memory map for Linux */ 162*a373024eSAngelo Dureghello #define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + \ 163*a373024eSAngelo Dureghello (CONFIG_SYS_SDRAM_SIZE << 20)) 164*a373024eSAngelo Dureghello 165*a373024eSAngelo Dureghello /* Configuration for environment 166*a373024eSAngelo Dureghello * Environment is embedded in u-boot in the second sector of the flash 167*a373024eSAngelo Dureghello */ 168*a373024eSAngelo Dureghello 169*a373024eSAngelo Dureghello #if defined(CONFIG_CF_SBF) 170*a373024eSAngelo Dureghello #define CONFIG_ENV_IS_IN_SPI_FLASH 1 171*a373024eSAngelo Dureghello #define CONFIG_ENV_SPI_CS 1 172*a373024eSAngelo Dureghello #define CONFIG_ENV_OFFSET 0x40000 173*a373024eSAngelo Dureghello #define CONFIG_ENV_SIZE 0x2000 174*a373024eSAngelo Dureghello #define CONFIG_ENV_SECT_SIZE 0x10000 175*a373024eSAngelo Dureghello #endif 176*a373024eSAngelo Dureghello 177*a373024eSAngelo Dureghello #undef CONFIG_ENV_OVERWRITE 178*a373024eSAngelo Dureghello 179*a373024eSAngelo Dureghello /* Cache Configuration */ 180*a373024eSAngelo Dureghello #define CONFIG_SYS_CACHELINE_SIZE 16 181*a373024eSAngelo Dureghello #define ICACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \ 182*a373024eSAngelo Dureghello CONFIG_SYS_INIT_RAM_SIZE - 8) 183*a373024eSAngelo Dureghello #define DCACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \ 184*a373024eSAngelo Dureghello CONFIG_SYS_INIT_RAM_SIZE - 4) 185*a373024eSAngelo Dureghello #define CONFIG_SYS_ICACHE_INV (CF_CACR_BCINVA + CF_CACR_ICINVA) 186*a373024eSAngelo Dureghello #define CONFIG_SYS_DCACHE_INV (CF_CACR_DCINVA) 187*a373024eSAngelo Dureghello #define CONFIG_SYS_CACHE_ACR2 (CONFIG_SYS_SDRAM_BASE | \ 188*a373024eSAngelo Dureghello CF_ADDRMASK(CONFIG_SYS_SDRAM_SIZE) | \ 189*a373024eSAngelo Dureghello CF_ACR_EN | CF_ACR_SM_ALL) 190*a373024eSAngelo Dureghello #define CONFIG_SYS_CACHE_ICACR (CF_CACR_BEC | CF_CACR_IEC | \ 191*a373024eSAngelo Dureghello CF_CACR_ICINVA | CF_CACR_EUSP) 192*a373024eSAngelo Dureghello #define CONFIG_SYS_CACHE_DCACR ((CONFIG_SYS_CACHE_ICACR | \ 193*a373024eSAngelo Dureghello CF_CACR_DEC | CF_CACR_DDCM_P | \ 194*a373024eSAngelo Dureghello CF_CACR_DCINVA) & ~CF_CACR_ICINVA) 195*a373024eSAngelo Dureghello 196*a373024eSAngelo Dureghello #define CACR_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \ 197*a373024eSAngelo Dureghello CONFIG_SYS_INIT_RAM_SIZE - 12) 198*a373024eSAngelo Dureghello 199*a373024eSAngelo Dureghello #endif /* __STMARK2_CONFIG_H */ 200