Mario Six | 190ab40 | 2019-01-21 09:17:33 +0100 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright (C) 2006 Freescale Semiconductor, Inc. |
| 4 | * Dave Liu <daveliu@freescale.com> |
| 5 | * |
| 6 | * Copyright (C) 2007 Logic Product Development, Inc. |
| 7 | * Peter Barada <peterb@logicpd.com> |
| 8 | * |
| 9 | * Copyright (C) 2007 MontaVista Software, Inc. |
| 10 | * Anton Vorontsov <avorontsov@ru.mvista.com> |
| 11 | * |
| 12 | * (C) Copyright 2008 |
| 13 | * Heiko Schocher, DENX Software Engineering, hs@denx.de. |
| 14 | * |
| 15 | * (C) Copyright 2010-2013 |
| 16 | * Lukas Roggli, KEYMILE Ltd, lukas.roggli@keymile.com |
| 17 | * Holger Brunck, Keymile GmbH, holger.bruncl@keymile.com |
| 18 | */ |
| 19 | |
| 20 | #ifndef __CONFIG_H |
| 21 | #define __CONFIG_H |
| 22 | |
| 23 | /* |
| 24 | * High Level Configuration Options |
| 25 | */ |
| 26 | #define CONFIG_KM_BOARD_NAME "kmopti2" |
| 27 | #define CONFIG_HOSTNAME "kmopti2" |
| 28 | |
| 29 | /* |
| 30 | * High Level Configuration Options |
| 31 | */ |
| 32 | #define CONFIG_QE /* Has QE */ |
| 33 | #define CONFIG_KM8321 /* Keymile PBEC8321 board specific */ |
| 34 | |
| 35 | #define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0" |
| 36 | |
| 37 | /* include common defines/options for all 83xx Keymile boards */ |
| 38 | #include "km83xx-common.h" |
| 39 | |
| 40 | /* |
| 41 | * System IO Config |
| 42 | */ |
| 43 | #define CONFIG_SYS_SICRL SICRL_IRQ_CKS |
| 44 | |
| 45 | /* |
| 46 | * Hardware Reset Configuration Word |
| 47 | */ |
| 48 | #define CONFIG_SYS_HRCW_LOW (\ |
| 49 | HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \ |
| 50 | HRCWL_DDR_TO_SCB_CLK_2X1 | \ |
| 51 | HRCWL_CSB_TO_CLKIN_2X1 | \ |
| 52 | HRCWL_CORE_TO_CSB_2_5X1 | \ |
| 53 | HRCWL_CE_PLL_VCO_DIV_2 | \ |
| 54 | HRCWL_CE_TO_PLL_1X3) |
| 55 | |
| 56 | #define CONFIG_SYS_HRCW_HIGH (\ |
| 57 | HRCWH_PCI_AGENT | \ |
| 58 | HRCWH_PCI_ARBITER_DISABLE | \ |
| 59 | HRCWH_CORE_ENABLE | \ |
| 60 | HRCWH_FROM_0X00000100 | \ |
| 61 | HRCWH_BOOTSEQ_DISABLE | \ |
| 62 | HRCWH_SW_WATCHDOG_DISABLE | \ |
| 63 | HRCWH_ROM_LOC_LOCAL_16BIT | \ |
| 64 | HRCWH_BIG_ENDIAN | \ |
| 65 | HRCWH_LALE_NORMAL) |
| 66 | |
| 67 | #define CONFIG_SYS_DDRCDR (\ |
| 68 | DDRCDR_EN | \ |
| 69 | DDRCDR_PZ_MAXZ | \ |
| 70 | DDRCDR_NZ_MAXZ | \ |
| 71 | DDRCDR_M_ODR) |
| 72 | |
| 73 | #define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f |
| 74 | #define CONFIG_SYS_DDR_SDRAM_CFG (SDRAM_CFG_SDRAM_TYPE_DDR2 | \ |
| 75 | SDRAM_CFG_32_BE | \ |
| 76 | SDRAM_CFG_SREN | \ |
| 77 | SDRAM_CFG_HSE) |
| 78 | |
| 79 | #define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000 |
| 80 | #define CONFIG_SYS_DDR_CLK_CNTL (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05) |
| 81 | #define CONFIG_SYS_DDR_INTERVAL ((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \ |
| 82 | (0x200 << SDRAM_INTERVAL_REFINT_SHIFT)) |
| 83 | |
| 84 | #define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \ |
| 85 | CSCONFIG_ODT_WR_CFG | \ |
| 86 | CSCONFIG_ROW_BIT_13 | \ |
| 87 | CSCONFIG_COL_BIT_10) |
| 88 | |
| 89 | #define CONFIG_SYS_DDR_MODE 0x47860242 |
| 90 | #define CONFIG_SYS_DDR_MODE2 0x8080c000 |
| 91 | |
| 92 | #define CONFIG_SYS_DDR_TIMING_0 ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \ |
| 93 | (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \ |
| 94 | (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \ |
| 95 | (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \ |
| 96 | (0 << TIMING_CFG0_WWT_SHIFT) | \ |
| 97 | (0 << TIMING_CFG0_RRT_SHIFT) | \ |
| 98 | (0 << TIMING_CFG0_WRT_SHIFT) | \ |
| 99 | (0 << TIMING_CFG0_RWT_SHIFT)) |
| 100 | |
| 101 | #define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_40) | \ |
| 102 | (2 << TIMING_CFG1_WRTORD_SHIFT) | \ |
| 103 | (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \ |
| 104 | (3 << TIMING_CFG1_WRREC_SHIFT) | \ |
| 105 | (7 << TIMING_CFG1_REFREC_SHIFT) | \ |
| 106 | (3 << TIMING_CFG1_ACTTORW_SHIFT) | \ |
| 107 | (7 << TIMING_CFG1_ACTTOPRE_SHIFT) | \ |
| 108 | (3 << TIMING_CFG1_PRETOACT_SHIFT)) |
| 109 | |
| 110 | #define CONFIG_SYS_DDR_TIMING_2 ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \ |
| 111 | (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \ |
| 112 | (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \ |
| 113 | (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \ |
| 114 | (3 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \ |
| 115 | (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \ |
| 116 | (5 << TIMING_CFG2_CPO_SHIFT)) |
| 117 | |
| 118 | #define CONFIG_SYS_DDR_TIMING_3 0x00000000 |
| 119 | |
| 120 | #define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000 |
| 121 | #define CONFIG_SYS_KMBEC_FPGA_SIZE 128 |
| 122 | |
| 123 | /* EEprom support */ |
| 124 | #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 |
| 125 | |
| 126 | /* |
| 127 | * Local Bus Configuration & Clock Setup |
| 128 | */ |
| 129 | #define CONFIG_SYS_LCRR_DBYP 0x80000000 |
| 130 | #define CONFIG_SYS_LCRR_EADC 0x00010000 |
| 131 | #define CONFIG_SYS_LCRR_CLKDIV 0x00000002 |
| 132 | |
| 133 | #define CONFIG_SYS_LBC_LBCR 0x00000000 |
| 134 | |
| 135 | /* |
| 136 | * MMU Setup |
| 137 | */ |
| 138 | #define CONFIG_SYS_IBAT7L (0) |
| 139 | #define CONFIG_SYS_IBAT7U (0) |
| 140 | #define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L |
| 141 | #define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U |
| 142 | |
| 143 | #define CONFIG_SYS_APP1_BASE 0xA0000000 /* PAXG */ |
| 144 | #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */ |
| 145 | #define CONFIG_SYS_APP2_BASE 0xB0000000 /* PINC3 */ |
| 146 | #define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */ |
| 147 | |
| 148 | /* |
| 149 | * Init Local Bus Memory Controller: |
| 150 | * Device on board |
| 151 | * Bank Bus Machine PortSz Size TUDA1 TUXA1 TUGE1 KMSUPX4 KMOPTI2 |
| 152 | * ----------------------------------------------------------------------------- |
| 153 | * 2 Local GPCM 8 bit 256MB PAXG LPXF PAXI LPXF PAXE |
| 154 | * 3 Local GPCM 8 bit 256MB PINC3 PINC2 unused unused OPI2(16 bit) |
| 155 | * |
| 156 | * Device on board (continued) |
| 157 | * Bank Bus Machine PortSz Size KMTEPR2 |
| 158 | * ----------------------------------------------------------------------------- |
| 159 | * 2 Local GPCM 8 bit 256MB NVRAM |
| 160 | * 3 Local GPCM 8 bit 256MB TEP2 (16 bit) |
| 161 | */ |
| 162 | |
| 163 | /* |
| 164 | * Configuration for C2 on the local bus |
| 165 | */ |
| 166 | /* Window base at flash base */ |
| 167 | #define CONFIG_SYS_LBLAWBAR2_PRELIM CONFIG_SYS_APP1_BASE |
| 168 | /* Window size: 256 MB */ |
| 169 | #define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_256MB) |
| 170 | |
| 171 | #define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_APP1_BASE | \ |
| 172 | BR_PS_8 | \ |
| 173 | BR_MS_GPCM | \ |
| 174 | BR_V) |
| 175 | |
| 176 | #define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \ |
| 177 | OR_GPCM_CSNT | \ |
| 178 | OR_GPCM_ACS_DIV4 | \ |
| 179 | OR_GPCM_SCY_2 | \ |
| 180 | OR_GPCM_TRLX_SET | \ |
| 181 | OR_GPCM_EHTR_CLEAR | \ |
| 182 | OR_GPCM_EAD) |
| 183 | |
| 184 | /* |
| 185 | * Configuration for C3 on the local bus |
| 186 | */ |
| 187 | #define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE |
| 188 | #define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB) |
| 189 | #define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \ |
| 190 | BR_PS_16 | \ |
| 191 | BR_MS_GPCM | \ |
| 192 | BR_V) |
| 193 | #define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \ |
| 194 | OR_GPCM_SCY_4 | \ |
| 195 | OR_GPCM_TRLX_CLEAR | \ |
| 196 | OR_GPCM_EHTR_CLEAR) |
| 197 | /* |
| 198 | * MMU Setup |
| 199 | */ |
| 200 | /* APP1: icache cacheable, but dcache-inhibit and guarded */ |
| 201 | #define CONFIG_SYS_IBAT5L (CONFIG_SYS_APP1_BASE | \ |
| 202 | BATL_PP_RW | \ |
| 203 | BATL_MEMCOHERENCE) |
| 204 | /* 512M should also include APP2... */ |
| 205 | #define CONFIG_SYS_IBAT5U (CONFIG_SYS_APP1_BASE | \ |
| 206 | BATU_BL_256M | \ |
| 207 | BATU_VS | \ |
| 208 | BATU_VP) |
| 209 | #define CONFIG_SYS_DBAT5L (CONFIG_SYS_APP1_BASE | \ |
| 210 | BATL_PP_RW | \ |
| 211 | BATL_CACHEINHIBIT | \ |
| 212 | BATL_GUARDEDSTORAGE) |
| 213 | #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U |
| 214 | |
| 215 | /* APP2: icache cacheable, but dcache-inhibit and guarded */ |
| 216 | #define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | \ |
| 217 | BATL_PP_RW | \ |
| 218 | BATL_MEMCOHERENCE) |
| 219 | #define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | \ |
| 220 | BATU_BL_256M | \ |
| 221 | BATU_VS | \ |
| 222 | BATU_VP) |
| 223 | #define CONFIG_SYS_DBAT6L (CONFIG_SYS_APP2_BASE | \ |
| 224 | BATL_PP_RW | \ |
| 225 | BATL_CACHEINHIBIT | \ |
| 226 | BATL_GUARDEDSTORAGE) |
| 227 | #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U |
| 228 | |
| 229 | #define CONFIG_SYS_IBAT7L (0) |
| 230 | #define CONFIG_SYS_IBAT7U (0) |
| 231 | #define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L |
| 232 | #define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U |
| 233 | |
| 234 | #endif /* __CONFIG_H */ |