064097a631c0e62d54c63dbbdfa51568418e843d
[platform/kernel/u-boot.git] / include / configs / km_kirkwood.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2009
4  * Marvell Semiconductor <www.marvell.com>
5  * Prafulla Wadaskar <prafulla@marvell.com>
6  *
7  * (C) Copyright 2009
8  * Stefan Roese, DENX Software Engineering, sr@denx.de.
9  *
10  * (C) Copyright 2011-2012
11  * Holger Brunck, Keymile GmbH Hannover, holger.brunck@keymile.com
12  * Valentin Longchamp, Keymile AG, valentin.longchamp@keymile.com
13  */
14
15 /*
16  * for linking errors see
17  * http://lists.denx.de/pipermail/u-boot/2009-July/057350.html
18  */
19
20 #ifndef _CONFIG_KM_KIRKWOOD_H
21 #define _CONFIG_KM_KIRKWOOD_H
22
23 /* KM_KIRKWOOD */
24 #if defined(CONFIG_KM_KIRKWOOD)
25 #define CONFIG_HOSTNAME                 "km_kirkwood"
26 #define CONFIG_KM_DISABLE_PCIE
27
28 /* KM_KIRKWOOD_PCI */
29 #elif defined(CONFIG_KM_KIRKWOOD_PCI)
30 #define CONFIG_HOSTNAME                 "km_kirkwood_pci"
31 #define CONFIG_KM_UBI_PART_BOOT_OPTS            ",2048"
32 #define CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
33
34 /* KM_KIRKWOOD_128M16 */
35 #elif defined(CONFIG_KM_KIRKWOOD_128M16)
36 #define CONFIG_HOSTNAME                 "km_kirkwood_128m16"
37 #undef CONFIG_SYS_KWD_CONFIG
38 #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage_128M16_1.cfg
39 #define CONFIG_KM_DISABLE_PCIE
40
41 /* KM_NUSA / KM_SUGP1 */
42 #elif defined(CONFIG_KM_NUSA) || defined(CONFIG_KM_SUGP1)
43
44 # if defined(CONFIG_KM_NUSA)
45 #define CONFIG_HOSTNAME                 "kmnusa"
46 # elif defined(CONFIG_KM_SUGP1)
47 #define CONFIG_HOSTNAME                 "kmsugp1"
48 #define KM_PCIE_RESET_MPP7
49 #endif
50
51 #undef CONFIG_SYS_KWD_CONFIG
52 #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage_128M16_1.cfg
53
54 /* KMCOGE5UN */
55 #elif defined(CONFIG_KM_COGE5UN)
56 #undef  CONFIG_SYS_KWD_CONFIG
57 #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage_256M8_1.cfg
58 #define CONFIG_HOSTNAME                 "kmcoge5un"
59 #define CONFIG_KM_DISABLE_PCIE
60
61 /* KM_SUV31 */
62 #elif defined(CONFIG_KM_SUV31)
63 #define CONFIG_HOSTNAME                 "kmsuv31"
64 #undef CONFIG_SYS_KWD_CONFIG
65 #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage_128M16_1.cfg
66 #define CONFIG_KM_UBI_PART_BOOT_OPTS            ",2048"
67 #define CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
68 #else
69 #error ("Board unsupported")
70 #endif
71
72 /* include common defines/options for all arm based Keymile boards */
73 #include "km/km_arm.h"
74
75 #if defined(CONFIG_KM_PIGGY4_88E6352)
76 /*
77  * Some keymile boards like mgcoge5un & nusa1 have their PIGGY4 connected via
78  * an Marvell 88E6352 simple switch.
79  * In this case we have to change the default settings for the etherent mac.
80  * There is NO ethernet phy. The ARM and Switch are conencted directly over
81  * RGMII in MAC-MAC mode
82  * In this case 1GBit full duplex and autoneg off
83  */
84 #define PORT_SERIAL_CONTROL_VALUE               ( \
85         MVGBE_FORCE_LINK_PASS                       | \
86         MVGBE_DIS_AUTO_NEG_FOR_DUPLX            | \
87         MVGBE_DIS_AUTO_NEG_FOR_FLOW_CTRL        | \
88         MVGBE_ADV_NO_FLOW_CTRL                      | \
89         MVGBE_FORCE_FC_MODE_NO_PAUSE_DIS_TX     | \
90         MVGBE_FORCE_BP_MODE_NO_JAM                  | \
91         (1 << 9) /* Reserved bit has to be 1 */ | \
92         MVGBE_DO_NOT_FORCE_LINK_FAIL            | \
93         MVGBE_DIS_AUTO_NEG_SPEED_GMII           | \
94         MVGBE_DTE_ADV_0                                 | \
95         MVGBE_MIIPHY_MAC_MODE                       | \
96         MVGBE_AUTO_NEG_NO_CHANGE                    | \
97         MVGBE_MAX_RX_PACKET_1552BYTE            | \
98         MVGBE_CLR_EXT_LOOPBACK                      | \
99         MVGBE_SET_FULL_DUPLEX_MODE                  | \
100         MVGBE_EN_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX |\
101         MVGBE_SET_GMII_SPEED_TO_1000        |\
102         MVGBE_SET_MII_SPEED_TO_100)
103
104 #endif
105
106 #ifdef CONFIG_KM_PIGGY4_88E6061
107 /*
108  * Some keymile boards like mgcoge5un have their PIGGY4 connected via
109  * an Marvell 88E6061 simple switch.
110  * In this case we have to change the default settings for the
111  * ethernet phy connected to the kirkwood.
112  * In this case 100MB full duplex and autoneg off
113  */
114 #define PORT_SERIAL_CONTROL_VALUE               ( \
115         MVGBE_FORCE_LINK_PASS                   | \
116         MVGBE_DIS_AUTO_NEG_FOR_DUPLX            | \
117         MVGBE_DIS_AUTO_NEG_FOR_FLOW_CTRL        | \
118         MVGBE_ADV_NO_FLOW_CTRL                  | \
119         MVGBE_FORCE_FC_MODE_NO_PAUSE_DIS_TX     | \
120         MVGBE_FORCE_BP_MODE_NO_JAM              | \
121         (1 << 9) /* Reserved bit has to be 1 */ | \
122         MVGBE_DO_NOT_FORCE_LINK_FAIL            | \
123         MVGBE_DIS_AUTO_NEG_SPEED_GMII           | \
124         MVGBE_DTE_ADV_0                         | \
125         MVGBE_MIIPHY_MAC_MODE                   | \
126         MVGBE_AUTO_NEG_NO_CHANGE                | \
127         MVGBE_MAX_RX_PACKET_1552BYTE            | \
128         MVGBE_CLR_EXT_LOOPBACK                  | \
129         MVGBE_SET_FULL_DUPLEX_MODE              | \
130         MVGBE_DIS_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX        |\
131         MVGBE_SET_GMII_SPEED_TO_10_100  |\
132         MVGBE_SET_MII_SPEED_TO_100)
133 #endif
134
135 #ifdef CONFIG_KM_DISABLE_PCIE
136 #undef  CONFIG_KIRKWOOD_PCIE_INIT
137 #endif
138
139 #endif /* _CONFIG_KM_KIRKWOOD */