xref: /openbmc/u-boot/board/zyxel/nsa310s/nsa310s.h (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
2f1df81c4SGerald Kerma /*
3f1df81c4SGerald Kerma  * Copyright (C) 2015
4f1df81c4SGerald Kerma  * Gerald Kerma <dreagle@doukki.net>
5f1df81c4SGerald Kerma  * Tony Dinh <mibodhi@gmail.com>
6f1df81c4SGerald Kerma  */
7f1df81c4SGerald Kerma 
8f1df81c4SGerald Kerma #ifndef __NSA310S_H
9f1df81c4SGerald Kerma #define __NSA310S_H
10f1df81c4SGerald Kerma 
11f1df81c4SGerald Kerma /* low GPIO's */
12f1df81c4SGerald Kerma #define HDD1_GREEN_LED		(1 << 16)
13f1df81c4SGerald Kerma #define HDD1_RED_LED		(1 << 13)
14f1df81c4SGerald Kerma #define USB_GREEN_LED		(1 << 15)
15f1df81c4SGerald Kerma #define USB_POWER			(1 << 21)
16f1df81c4SGerald Kerma #define SYS_GREEN_LED		(1 << 28)
17f1df81c4SGerald Kerma #define SYS_ORANGE_LED		(1 << 29)
18f1df81c4SGerald Kerma 
19f1df81c4SGerald Kerma #define COPY_GREEN_LED		(1 << 22)
20f1df81c4SGerald Kerma #define COPY_RED_LED		(1 << 23)
21f1df81c4SGerald Kerma 
22f1df81c4SGerald Kerma #define PIN_USB_GREEN_LED	15
23f1df81c4SGerald Kerma #define PIN_USB_POWER		21
24f1df81c4SGerald Kerma 
25f1df81c4SGerald Kerma #define NSA310S_OE_LOW		(~(0))
26f1df81c4SGerald Kerma #define NSA310S_VAL_LOW		(SYS_GREEN_LED | USB_POWER)
27f1df81c4SGerald Kerma 
28f1df81c4SGerald Kerma /* high GPIO's */
29f1df81c4SGerald Kerma #define HDD2_GREEN_LED		(1 << 2)
30f1df81c4SGerald Kerma #define HDD2_POWER			(1 << 1)
31f1df81c4SGerald Kerma 
32f1df81c4SGerald Kerma #define NSA310S_OE_HIGH		(~(0))
33f1df81c4SGerald Kerma #define NSA310S_VAL_HIGH	(HDD2_POWER)
34f1df81c4SGerald Kerma 
35f1df81c4SGerald Kerma /* PHY related */
36f1df81c4SGerald Kerma #define MV88E1318_PGADR_REG		22
37f1df81c4SGerald Kerma #define MV88E1318_MAC_CTRL_PG	2
38f1df81c4SGerald Kerma #define MV88E1318_MAC_CTRL_REG	21
39f1df81c4SGerald Kerma #define MV88E1318_RGMII_TX_CTRL	(1 << 4)
40f1df81c4SGerald Kerma #define MV88E1318_RGMII_RX_CTRL	(1 << 5)
41f1df81c4SGerald Kerma #define MV88E1318_LED_PG		3
42f1df81c4SGerald Kerma #define MV88E1318_LED_POL_REG	17
43f1df81c4SGerald Kerma #define MV88E1318_LED2_4		(1 << 4)
44f1df81c4SGerald Kerma #define MV88E1318_LED2_5		(1 << 5)
45f1df81c4SGerald Kerma 
46f1df81c4SGerald Kerma #endif /* __NSA310S_H */
47