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_JFFS2_CMDLINE 61*a373024eSAngelo Dureghello #define CONFIG_JFFS2_DEV "nor0" 62*a373024eSAngelo Dureghello #define MTDIDS_DEFAULT "nor0=spi-flash.0" 63*a373024eSAngelo Dureghello #define MTDPARTS_DEFAULT \ 64*a373024eSAngelo Dureghello "mtdparts=spi-flash.0:" \ 65*a373024eSAngelo Dureghello "1m(u-boot)," \ 66*a373024eSAngelo Dureghello "7m(kernel)," \ 67*a373024eSAngelo Dureghello "-(rootfs)" 68*a373024eSAngelo Dureghello 69*a373024eSAngelo Dureghello /* Timer */ 70*a373024eSAngelo Dureghello #define CONFIG_MCFTMR 71*a373024eSAngelo Dureghello #undef CONFIG_MCFPIT 72*a373024eSAngelo Dureghello 73*a373024eSAngelo Dureghello /* DSPI and Serial Flash */ 74*a373024eSAngelo Dureghello #define CONFIG_CF_DSPI 75*a373024eSAngelo Dureghello #define CONFIG_SF_DEFAULT_SPEED 50000000 76*a373024eSAngelo Dureghello #define CONFIG_SERIAL_FLASH 77*a373024eSAngelo Dureghello #define CONFIG_HARD_SPI 78*a373024eSAngelo Dureghello #define CONFIG_ENV_SPI_BUS 0 79*a373024eSAngelo Dureghello #define CONFIG_ENV_SPI_CS 1 80*a373024eSAngelo Dureghello 81*a373024eSAngelo Dureghello #define CONFIG_SYS_SBFHDR_SIZE 0x7 82*a373024eSAngelo Dureghello 83*a373024eSAngelo Dureghello #define CONFIG_SYS_DSPI_CTAR0 (DSPI_CTAR_TRSZ(7) | \ 84*a373024eSAngelo Dureghello DSPI_CTAR_PCSSCK_1CLK | \ 85*a373024eSAngelo Dureghello DSPI_CTAR_PASC(0) | \ 86*a373024eSAngelo Dureghello DSPI_CTAR_PDT(0) | \ 87*a373024eSAngelo Dureghello DSPI_CTAR_CSSCK(0) | \ 88*a373024eSAngelo Dureghello DSPI_CTAR_ASC(0) | \ 89*a373024eSAngelo Dureghello DSPI_CTAR_DT(1) | \ 90*a373024eSAngelo Dureghello DSPI_CTAR_BR(6)) 91*a373024eSAngelo Dureghello #define CONFIG_SYS_DSPI_CTAR1 (CONFIG_SYS_DSPI_CTAR0) 92*a373024eSAngelo Dureghello #define CONFIG_SYS_DSPI_CTAR2 (CONFIG_SYS_DSPI_CTAR0) 93*a373024eSAngelo Dureghello 94*a373024eSAngelo Dureghello /* Input, PCI, Flexbus, and VCO */ 95*a373024eSAngelo Dureghello #define CONFIG_EXTRA_CLOCK 96*a373024eSAngelo Dureghello 97*a373024eSAngelo Dureghello #define CONFIG_PRAM 2048 /* 2048 KB */ 98*a373024eSAngelo Dureghello #define CONFIG_SYS_LONGHELP 99*a373024eSAngelo Dureghello #define CONFIG_AUTO_COMPLETE 100*a373024eSAngelo Dureghello #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ 101*a373024eSAngelo Dureghello 102*a373024eSAngelo Dureghello /* Print Buffer Size */ 103*a373024eSAngelo Dureghello #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ 104*a373024eSAngelo Dureghello sizeof(CONFIG_SYS_PROMPT) + 16) 105*a373024eSAngelo Dureghello #define CONFIG_SYS_MAXARGS 16 106*a373024eSAngelo Dureghello /* Boot Argument Buffer Size */ 107*a373024eSAngelo Dureghello #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE 108*a373024eSAngelo Dureghello 109*a373024eSAngelo Dureghello #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x10000) 110*a373024eSAngelo Dureghello #define CONFIG_SYS_MBAR 0xFC000000 111*a373024eSAngelo Dureghello 112*a373024eSAngelo Dureghello /* 113*a373024eSAngelo Dureghello * Definitions for initial stack pointer and data area (in internal SRAM) 114*a373024eSAngelo Dureghello */ 115*a373024eSAngelo Dureghello #define CONFIG_SYS_INIT_RAM_ADDR 0x80000000 116*a373024eSAngelo Dureghello /* End of used area in internal SRAM */ 117*a373024eSAngelo Dureghello #define CONFIG_SYS_INIT_RAM_SIZE 0x10000 118*a373024eSAngelo Dureghello #define CONFIG_SYS_INIT_RAM_CTRL 0x221 119*a373024eSAngelo Dureghello #define CONFIG_SYS_GBL_DATA_OFFSET ((CONFIG_SYS_INIT_RAM_SIZE - \ 120*a373024eSAngelo Dureghello GENERATED_GBL_DATA_SIZE) - 32) 121*a373024eSAngelo Dureghello #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET 122*a373024eSAngelo Dureghello #define CONFIG_SYS_SBFHDR_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - 32) 123*a373024eSAngelo Dureghello 124*a373024eSAngelo Dureghello /* 125*a373024eSAngelo Dureghello * Start addresses for the final memory configuration 126*a373024eSAngelo Dureghello * (Set up by the startup code) 127*a373024eSAngelo Dureghello * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0 128*a373024eSAngelo Dureghello */ 129*a373024eSAngelo Dureghello #define CONFIG_SYS_SDRAM_BASE 0x40000000 130*a373024eSAngelo Dureghello #define CONFIG_SYS_SDRAM_SIZE 128 /* SDRAM size in MB */ 131*a373024eSAngelo Dureghello 132*a373024eSAngelo Dureghello #define CONFIG_SYS_MEMTEST_START (CONFIG_SYS_SDRAM_BASE + 0x400) 133*a373024eSAngelo Dureghello #define CONFIG_SYS_MEMTEST_END ((CONFIG_SYS_SDRAM_SIZE - 3) << 20) 134*a373024eSAngelo Dureghello #define CONFIG_SYS_DRAM_TEST 135*a373024eSAngelo Dureghello 136*a373024eSAngelo Dureghello #if defined(CONFIG_CF_SBF) 137*a373024eSAngelo Dureghello #define CONFIG_SERIAL_BOOT 138*a373024eSAngelo Dureghello #endif 139*a373024eSAngelo Dureghello 140*a373024eSAngelo Dureghello #if defined(CONFIG_SERIAL_BOOT) 141*a373024eSAngelo Dureghello #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_TEXT_BASE + 0x400) 142*a373024eSAngelo Dureghello #else 143*a373024eSAngelo Dureghello #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_FLASH_BASE + 0x400) 144*a373024eSAngelo Dureghello #endif 145*a373024eSAngelo Dureghello 146*a373024eSAngelo Dureghello #define CONFIG_SYS_BOOTPARAMS_LEN (64 * 1024) 147*a373024eSAngelo Dureghello /* Reserve 256 kB for Monitor */ 148*a373024eSAngelo Dureghello #define CONFIG_SYS_MONITOR_LEN (256 << 10) 149*a373024eSAngelo Dureghello /* Reserve 256 kB for malloc() */ 150*a373024eSAngelo Dureghello #define CONFIG_SYS_MALLOC_LEN (256 << 10) 151*a373024eSAngelo Dureghello 152*a373024eSAngelo Dureghello /* 153*a373024eSAngelo Dureghello * For booting Linux, the board info and command line data 154*a373024eSAngelo Dureghello * have to be in the first 8 MB of memory, since this is 155*a373024eSAngelo Dureghello * the maximum mapped by the Linux kernel during initialization ?? 156*a373024eSAngelo Dureghello */ 157*a373024eSAngelo Dureghello /* Initial Memory map for Linux */ 158*a373024eSAngelo Dureghello #define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + \ 159*a373024eSAngelo Dureghello (CONFIG_SYS_SDRAM_SIZE << 20)) 160*a373024eSAngelo Dureghello 161*a373024eSAngelo Dureghello /* Configuration for environment 162*a373024eSAngelo Dureghello * Environment is embedded in u-boot in the second sector of the flash 163*a373024eSAngelo Dureghello */ 164*a373024eSAngelo Dureghello 165*a373024eSAngelo Dureghello #if defined(CONFIG_CF_SBF) 166*a373024eSAngelo Dureghello #define CONFIG_ENV_IS_IN_SPI_FLASH 1 167*a373024eSAngelo Dureghello #define CONFIG_ENV_SPI_CS 1 168*a373024eSAngelo Dureghello #define CONFIG_ENV_OFFSET 0x40000 169*a373024eSAngelo Dureghello #define CONFIG_ENV_SIZE 0x2000 170*a373024eSAngelo Dureghello #define CONFIG_ENV_SECT_SIZE 0x10000 171*a373024eSAngelo Dureghello #endif 172*a373024eSAngelo Dureghello 173*a373024eSAngelo Dureghello #undef CONFIG_ENV_OVERWRITE 174*a373024eSAngelo Dureghello 175*a373024eSAngelo Dureghello /* Cache Configuration */ 176*a373024eSAngelo Dureghello #define CONFIG_SYS_CACHELINE_SIZE 16 177*a373024eSAngelo Dureghello #define ICACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \ 178*a373024eSAngelo Dureghello CONFIG_SYS_INIT_RAM_SIZE - 8) 179*a373024eSAngelo Dureghello #define DCACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \ 180*a373024eSAngelo Dureghello CONFIG_SYS_INIT_RAM_SIZE - 4) 181*a373024eSAngelo Dureghello #define CONFIG_SYS_ICACHE_INV (CF_CACR_BCINVA + CF_CACR_ICINVA) 182*a373024eSAngelo Dureghello #define CONFIG_SYS_DCACHE_INV (CF_CACR_DCINVA) 183*a373024eSAngelo Dureghello #define CONFIG_SYS_CACHE_ACR2 (CONFIG_SYS_SDRAM_BASE | \ 184*a373024eSAngelo Dureghello CF_ADDRMASK(CONFIG_SYS_SDRAM_SIZE) | \ 185*a373024eSAngelo Dureghello CF_ACR_EN | CF_ACR_SM_ALL) 186*a373024eSAngelo Dureghello #define CONFIG_SYS_CACHE_ICACR (CF_CACR_BEC | CF_CACR_IEC | \ 187*a373024eSAngelo Dureghello CF_CACR_ICINVA | CF_CACR_EUSP) 188*a373024eSAngelo Dureghello #define CONFIG_SYS_CACHE_DCACR ((CONFIG_SYS_CACHE_ICACR | \ 189*a373024eSAngelo Dureghello CF_CACR_DEC | CF_CACR_DDCM_P | \ 190*a373024eSAngelo Dureghello CF_CACR_DCINVA) & ~CF_CACR_ICINVA) 191*a373024eSAngelo Dureghello 192*a373024eSAngelo Dureghello #define CACR_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \ 193*a373024eSAngelo Dureghello CONFIG_SYS_INIT_RAM_SIZE - 12) 194*a373024eSAngelo Dureghello 195*a373024eSAngelo Dureghello #endif /* __STMARK2_CONFIG_H */ 196