blob: f22d73b8d3edc7f03fec2010faf268520947ab17 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Heiko Schocher8a410f82010-04-01 12:10:30 +02002/*
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 *
Holger Brunckc20c9072013-01-21 03:55:25 +000015 * (C) Copyright 2010-2013
Heiko Schocher8a410f82010-04-01 12:10:30 +020016 * Lukas Roggli, KEYMILE Ltd, lukas.roggli@keymile.com
Holger Brunck4a630a72011-12-14 16:21:44 +010017 * Holger Brunck, Keymile GmbH, holger.bruncl@keymile.com
Heiko Schocher8a410f82010-04-01 12:10:30 +020018 */
19
20#ifndef __CONFIG_H
21#define __CONFIG_H
22
23/*
24 * High Level Configuration Options
25 */
Holger Brunckc20c9072013-01-21 03:55:25 +000026#if defined(CONFIG_KMSUPX5)
Holger Brunck50c57952012-03-21 13:42:42 +010027#define CONFIG_KM_BOARD_NAME "kmsupx5"
Mario Six790d8442018-03-28 14:38:20 +020028#define CONFIG_HOSTNAME "kmsupx5"
Holger Brunckc20c9072013-01-21 03:55:25 +000029#elif defined(CONFIG_TUGE1)
Holger Brunck50c57952012-03-21 13:42:42 +010030#define CONFIG_KM_BOARD_NAME "tuge1"
Mario Six790d8442018-03-28 14:38:20 +020031#define CONFIG_HOSTNAME "tuge1"
Holger Brunckc20c9072013-01-21 03:55:25 +000032#elif defined(CONFIG_TUXX1) /* TUXX1 board (tuxa1/tuda1) specific */
Holger Brunck50c57952012-03-21 13:42:42 +010033#define CONFIG_KM_BOARD_NAME "tuxx1"
Mario Six790d8442018-03-28 14:38:20 +020034#define CONFIG_HOSTNAME "tuxx1"
Holger Brunckdd0f6052013-01-21 03:55:26 +000035#elif defined(CONFIG_KMOPTI2)
36#define CONFIG_KM_BOARD_NAME "kmopti2"
Mario Six790d8442018-03-28 14:38:20 +020037#define CONFIG_HOSTNAME "kmopti2"
Christoph Dietrich4c1c6ae2015-11-17 10:53:24 +010038#elif defined(CONFIG_KMTEPR2)
39#define CONFIG_KM_BOARD_NAME "kmtepr2"
Mario Six790d8442018-03-28 14:38:20 +020040#define CONFIG_HOSTNAME "kmtepr2"
Holger Brunckc20c9072013-01-21 03:55:25 +000041#else
42#error ("Board not supported")
Holger Brunck2a1c5bd2011-12-14 16:21:45 +010043#endif
Heiko Schocher8a410f82010-04-01 12:10:30 +020044
Heiko Schocher3a8dd212011-03-08 10:47:39 +010045/* include common defines/options for all 8321 Keymile boards */
Valentin Longchamp2f968d82011-05-04 01:47:33 +000046#include "km/km8321-common.h"
Heiko Schocher8a410f82010-04-01 12:10:30 +020047
Heiko Schocher8a410f82010-04-01 12:10:30 +020048#define CONFIG_SYS_APP1_BASE 0xA0000000 /* PAXG */
49#define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
Christoph Dietrich4c1c6ae2015-11-17 10:53:24 +010050#if defined(CONFIG_TUXX1) || defined(CONFIG_KMOPTI2) || defined(CONFIG_KMTEPR2)
Heiko Schocher8a410f82010-04-01 12:10:30 +020051#define CONFIG_SYS_APP2_BASE 0xB0000000 /* PINC3 */
52#define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
Holger Brunck2a1c5bd2011-12-14 16:21:45 +010053#endif
Heiko Schocher8a410f82010-04-01 12:10:30 +020054
Heiko Schocher8a410f82010-04-01 12:10:30 +020055/*
Heiko Schocher8a410f82010-04-01 12:10:30 +020056 * Init Local Bus Memory Controller:
Christoph Dietrich4c1c6ae2015-11-17 10:53:24 +010057 * Device on board
58 * Bank Bus Machine PortSz Size TUDA1 TUXA1 TUGE1 KMSUPX4 KMOPTI2
59 * -----------------------------------------------------------------------------
60 * 2 Local GPCM 8 bit 256MB PAXG LPXF PAXI LPXF PAXE
61 * 3 Local GPCM 8 bit 256MB PINC3 PINC2 unused unused OPI2(16 bit)
Heiko Schocher8a410f82010-04-01 12:10:30 +020062 *
Christoph Dietrich4c1c6ae2015-11-17 10:53:24 +010063 * Device on board (continued)
64 * Bank Bus Machine PortSz Size KMTEPR2
65 * -----------------------------------------------------------------------------
66 * 2 Local GPCM 8 bit 256MB NVRAM
67 * 3 Local GPCM 8 bit 256MB TEP2 (16 bit)
Heiko Schocher8a410f82010-04-01 12:10:30 +020068 */
69
Christoph Dietrich4c1c6ae2015-11-17 10:53:24 +010070#if defined(CONFIG_KMTEPRO2)
71/*
72 * Configuration for C2 (NVRAM) on the local bus
73 */
74#define CONFIG_SYS_LBLAWBAR2_PRELIM CONFIG_SYS_APP1_BASE
75#define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
76#define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_APP1_BASE | \
77 BR_PS_8 | \
78 BR_MS_GPCM | \
79 BR_V)
80#define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
81 OR_GPCM_CSNT | \
82 OR_GPCM_ACS_DIV2 | \
83 OR_GPCM_XACS | \
84 OR_GPCM_SCY_2 | \
85 OR_GPCM_TRLX_SET | \
86 OR_GPCM_EHTR_SET | \
87 OR_GPCM_EAD)
88#else
Heiko Schocher8a410f82010-04-01 12:10:30 +020089/*
Holger Brunck4a630a72011-12-14 16:21:44 +010090 * Configuration for C2 on the local bus
Heiko Schocher8a410f82010-04-01 12:10:30 +020091 */
92/* Window base at flash base */
93#define CONFIG_SYS_LBLAWBAR2_PRELIM CONFIG_SYS_APP1_BASE
94/* Window size: 256 MB */
95#define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
96
97#define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_APP1_BASE | \
98 BR_PS_8 | \
99 BR_MS_GPCM | \
100 BR_V)
101
102#define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
103 OR_GPCM_CSNT | \
104 OR_GPCM_ACS_DIV4 | \
105 OR_GPCM_SCY_2 | \
Joe Hershbergerf05b9332011-10-11 23:57:30 -0500106 OR_GPCM_TRLX_SET | \
107 OR_GPCM_EHTR_CLEAR | \
Heiko Schocher8a410f82010-04-01 12:10:30 +0200108 OR_GPCM_EAD)
Christoph Dietrich4c1c6ae2015-11-17 10:53:24 +0100109#endif
110
Holger Brunckc20c9072013-01-21 03:55:25 +0000111#if defined(CONFIG_TUXX1)
Heiko Schocher8a410f82010-04-01 12:10:30 +0200112/*
Holger Brunck4a630a72011-12-14 16:21:44 +0100113 * Configuration for C3 on the local bus
Heiko Schocher8a410f82010-04-01 12:10:30 +0200114 */
115/* Access window base at PINC3 base */
116#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
117/* Window size: 256 MB */
118#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
119
120#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
121 BR_PS_8 | \
122 BR_MS_GPCM | \
123 BR_V)
124
125#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
126 OR_GPCM_CSNT | \
Joe Hershbergerf05b9332011-10-11 23:57:30 -0500127 OR_GPCM_ACS_DIV2 | \
128 OR_GPCM_SCY_2 | \
129 OR_GPCM_TRLX_SET | \
130 OR_GPCM_EHTR_CLEAR)
Heiko Schocher8a410f82010-04-01 12:10:30 +0200131
132#define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
133 0x0000c000 | \
134 MxMR_WLFx_2X)
Holger Brunck2a1c5bd2011-12-14 16:21:45 +0100135#endif
Heiko Schocher8a410f82010-04-01 12:10:30 +0200136
Christoph Dietrich4c1c6ae2015-11-17 10:53:24 +0100137#if defined(CONFIG_KMOPTI2) || defined(CONFIG_KMTEPR2)
Holger Brunckdd0f6052013-01-21 03:55:26 +0000138/*
139 * Configuration for C3 on the local bus
140 */
141#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
142#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
143#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
144 BR_PS_16 | \
145 BR_MS_GPCM | \
146 BR_V)
147#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
148 OR_GPCM_SCY_4 | \
149 OR_GPCM_TRLX_CLEAR | \
150 OR_GPCM_EHTR_CLEAR)
151#endif
152
Heiko Schocher8a410f82010-04-01 12:10:30 +0200153/*
154 * MMU Setup
155 */
Holger Brunck4a630a72011-12-14 16:21:44 +0100156/* APP1: icache cacheable, but dcache-inhibit and guarded */
Heiko Schocher8a410f82010-04-01 12:10:30 +0200157#define CONFIG_SYS_IBAT5L (CONFIG_SYS_APP1_BASE | \
Joe Hershbergerbfd89732011-10-11 23:57:28 -0500158 BATL_PP_RW | \
Heiko Schocher8a410f82010-04-01 12:10:30 +0200159 BATL_MEMCOHERENCE)
160/* 512M should also include APP2... */
161#define CONFIG_SYS_IBAT5U (CONFIG_SYS_APP1_BASE | \
162 BATU_BL_256M | \
163 BATU_VS | \
164 BATU_VP)
165#define CONFIG_SYS_DBAT5L (CONFIG_SYS_APP1_BASE | \
Joe Hershbergerbfd89732011-10-11 23:57:28 -0500166 BATL_PP_RW | \
Heiko Schocher8a410f82010-04-01 12:10:30 +0200167 BATL_CACHEINHIBIT | \
168 BATL_GUARDEDSTORAGE)
169#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
170
Holger Brunckc20c9072013-01-21 03:55:25 +0000171#if defined(CONFIG_TUGE1) || defined(CONFIG_KMSUPX5)
Holger Brunck2a1c5bd2011-12-14 16:21:45 +0100172#define CONFIG_SYS_IBAT6L (0)
173#define CONFIG_SYS_IBAT6U (0)
174#define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
175#else
Holger Brunck4a630a72011-12-14 16:21:44 +0100176/* APP2: icache cacheable, but dcache-inhibit and guarded */
Heiko Schocher8a410f82010-04-01 12:10:30 +0200177#define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | \
Joe Hershbergerbfd89732011-10-11 23:57:28 -0500178 BATL_PP_RW | \
Heiko Schocher8a410f82010-04-01 12:10:30 +0200179 BATL_MEMCOHERENCE)
180#define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | \
181 BATU_BL_256M | \
182 BATU_VS | \
183 BATU_VP)
184#define CONFIG_SYS_DBAT6L (CONFIG_SYS_APP2_BASE | \
Joe Hershbergerbfd89732011-10-11 23:57:28 -0500185 BATL_PP_RW | \
Heiko Schocher8a410f82010-04-01 12:10:30 +0200186 BATL_CACHEINHIBIT | \
187 BATL_GUARDEDSTORAGE)
Holger Brunck2a1c5bd2011-12-14 16:21:45 +0100188#endif
Heiko Schocher8a410f82010-04-01 12:10:30 +0200189#define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
190
191#define CONFIG_SYS_IBAT7L (0)
192#define CONFIG_SYS_IBAT7U (0)
193#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
194#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
Heiko Schocher8a410f82010-04-01 12:10:30 +0200195
196#endif /* __CONFIG_H */