1 /* 2 * Copyright (c) 2012 Michael Walle 3 * Michael Walle <michael@walle.cc> 4 * 5 * SPDX-License-Identifier: GPL-2.0+ 6 */ 7 8 #ifndef _CONFIG_LSXL_H 9 #define _CONFIG_LSXL_H 10 11 /* 12 * Version number information 13 */ 14 #if defined(CONFIG_LSCHLV2) 15 #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-lschl.cfg 16 #define CONFIG_MACH_TYPE 3006 17 #define CONFIG_SYS_TCLK 166666667 /* 166 MHz */ 18 #elif defined(CONFIG_LSXHL) 19 #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-lsxhl.cfg 20 #define CONFIG_MACH_TYPE 2663 21 /* CONFIG_SYS_TCLK is 200000000 by default */ 22 #else 23 #error "unknown board" 24 #endif 25 26 /* 27 * General configuration options 28 */ 29 #define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */ 30 #define CONFIG_KW88F6281 /* SOC Name */ 31 32 #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ 33 #define CONFIG_MISC_INIT_R 34 #define CONFIG_SHOW_BOOT_PROGRESS 35 36 #define CONFIG_KIRKWOOD_GPIO 37 38 #define CONFIG_SYS_NO_FLASH 39 40 /* 41 * Enable u-boot API for standalone programs. 42 */ 43 #define CONFIG_API 44 45 /* 46 * Commands configuration 47 */ 48 #define CONFIG_CMD_ENV 49 #define CONFIG_CMD_IDE 50 51 /* 52 * mv-common.h should be defined after CMD configs since it used them 53 * to enable certain macros 54 */ 55 #include "mv-common.h" 56 57 /* loading initramfs images without uimage header */ 58 #define CONFIG_SUPPORT_RAW_INITRD 59 60 /* ST M25P40 */ 61 #undef CONFIG_ENV_SPI_MAX_HZ 62 #define CONFIG_ENV_SPI_MAX_HZ 25000000 63 #undef CONFIG_SF_DEFAULT_SPEED 64 #define CONFIG_SF_DEFAULT_SPEED 25000000 65 66 /* 67 * Environment variables configurations 68 */ 69 #ifdef CONFIG_SPI_FLASH 70 #define CONFIG_SYS_MAX_FLASH_BANKS 1 71 #define CONFIG_SYS_MAX_FLASH_SECT 8 72 #define CONFIG_ENV_IS_IN_SPI_FLASH 1 73 #define CONFIG_ENV_SECT_SIZE 0x10000 /* 64K */ 74 #else 75 #define CONFIG_ENV_IS_NOWHERE 76 #endif 77 78 #define CONFIG_ENV_SIZE 0x10000 /* 64k */ 79 #define CONFIG_ENV_OFFSET 0x70000 /* env starts here */ 80 81 /* 82 * Default environment variables 83 */ 84 #define CONFIG_LOADADDR 0x00800000 85 #define CONFIG_BOOTCOMMAND "run bootcmd_${bootsource}" 86 #define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/sda2" 87 88 #if defined(CONFIG_LSXHL) 89 #define CONFIG_FDTFILE "kirkwood-lsxhl.dtb" 90 #elif defined(CONFIG_LSCHLV2) 91 #define CONFIG_FDTFILE "kirkwood-lschlv2.dtb" 92 #else 93 #error "Unsupported board" 94 #endif 95 96 #define CONFIG_EXTRA_ENV_SETTINGS \ 97 "bootsource=legacy\0" \ 98 "hdpart=0:1\0" \ 99 "kernel_addr=0x00800000\0" \ 100 "ramdisk_addr=0x01000000\0" \ 101 "fdt_addr=0x00ff0000\0" \ 102 "bootcmd_legacy=ide reset " \ 103 "&& load ide ${hdpart} ${kernel_addr} /uImage.buffalo " \ 104 "&& load ide ${hdpart} ${ramdisk_addr} /initrd.buffalo "\ 105 "&& bootm ${kernel_addr} ${ramdisk_addr}\0" \ 106 "bootcmd_net=bootp ${kernel_addr} vmlinuz " \ 107 "&& tftpboot ${ramdisk_addr} initrd.img " \ 108 "&& setenv ramdisk_len ${filesize} " \ 109 "&& tftpboot ${fdt_addr} " CONFIG_FDTFILE " " \ 110 "&& bootz ${kernel_addr} " \ 111 "${ramdisk_addr}:${ramdisk_len} ${fdt_addr}\0" \ 112 "bootcmd_hdd=ide reset " \ 113 "&& load ide ${hdpart} ${kernel_addr} /vmlinuz " \ 114 "&& load ide ${hdpart} ${ramdisk_addr} /initrd.img " \ 115 "&& setenv ramdisk_len ${filesize} " \ 116 "&& load ide ${hdpart} ${fdt_addr} /dtb " \ 117 "&& bootz ${kernel_addr} " \ 118 "${ramdisk_addr}:${ramdisk_len} ${fdt_addr}\0" \ 119 "bootcmd_usb=usb start " \ 120 "&& load usb 0:1 ${kernel_addr} /vmlinuz " \ 121 "&& load usb 0:1 ${ramdisk_addr} /initrd.img " \ 122 "&& setenv ramdisk_len ${filesize} " \ 123 "&& load usb 0:1 ${fdt_addr} " CONFIG_FDTFILE " " \ 124 "&& bootz ${kernel_addr} " \ 125 "${ramdisk_addr}:${ramdisk_len} ${fdt_addr}\0" \ 126 "bootcmd_rescue=run config_nc_dhcp; run nc\0" \ 127 "eraseenv=sf probe 0 " \ 128 "&& sf erase " __stringify(CONFIG_ENV_OFFSET) \ 129 " +" __stringify(CONFIG_ENV_SIZE) "\0" \ 130 "config_nc_dhcp=setenv autoload_old ${autoload}; " \ 131 "setenv autoload no " \ 132 "&& bootp " \ 133 "&& setenv ncip " \ 134 "&& setenv autoload ${autoload_old}; " \ 135 "setenv autoload_old\0" \ 136 "standard_env=setenv ipaddr; setenv netmask; setenv serverip; " \ 137 "setenv ncip; setenv gatewayip; setenv ethact; " \ 138 "setenv bootfile; setenv dnsip; " \ 139 "setenv bootsource legacy; run ser\0" \ 140 "restore_env=run standard_env; saveenv; reset\0" \ 141 "ser=setenv stdin serial; setenv stdout serial; " \ 142 "setenv stderr serial\0" \ 143 "nc=setenv stdin nc; setenv stdout nc; setenv stderr nc\0" \ 144 "stdin=serial\0" \ 145 "stdout=serial\0" \ 146 "stderr=serial\0" 147 148 /* 149 * Ethernet Driver configuration 150 */ 151 #ifdef CONFIG_CMD_NET 152 #define CONFIG_MVGBE_PORTS {0, 1} /* enable port 1 only */ 153 #define CONFIG_PHY_BASE_ADR 7 154 #undef CONFIG_RESET_PHY_R 155 #endif /* CONFIG_CMD_NET */ 156 157 #ifdef CONFIG_CMD_IDE 158 #undef CONFIG_IDE_LED 159 #undef CONFIG_SYS_IDE_MAXBUS 160 #define CONFIG_SYS_IDE_MAXBUS 1 161 #undef CONFIG_SYS_IDE_MAXDEVICE 162 #define CONFIG_SYS_IDE_MAXDEVICE 1 163 #define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET 164 #define CONFIG_SYS_64BIT_LBA 165 #endif 166 167 #endif /* _CONFIG_LSXL_H */ 168