4 * Copyright (C) 2005 Sandburst Corporation
6 * SPDX-License-Identifier: GPL-2.0+
11 #include <asm/processor.h>
13 #include <spd_sdram.h>
19 /* Chassis settings */
20 #define SBCOMMON_GPIO_PRI_N 0x00001000 /* 0 = Chassis Master, 1 = Slave */
21 #define SBCOMMON_GPIO_SEC_PRES 0x00000800 /* 1 = Other board present */
24 #define SBCOMMON_GPIO_DBGLED_0 0x00000400
25 #define SBCOMMON_GPIO_DBGLED_1 0x00000200
26 #define SBCOMMON_GPIO_DBGLED_2 0x00100000
27 #define SBCOMMON_GPIO_DBGLED_3 0x00000100
29 #define SBCOMMON_GPIO_DBGLEDS (SBCOMMON_GPIO_DBGLED_0 | \
30 SBCOMMON_GPIO_DBGLED_1 | \
31 SBCOMMON_GPIO_DBGLED_2 | \
32 SBCOMMON_GPIO_DBGLED_3)
34 #define SBCOMMON_GPIO_SYS_FAULT 0x00000080
35 #define SBCOMMON_GPIO_SYS_OTEMP 0x00000040
36 #define SBCOMMON_GPIO_SYS_STATUS 0x00000020
38 #define SBCOMMON_GPIO_SYS_LEDS (SBCOMMON_GPIO_SYS_STATUS)
40 #define SBCOMMON_GPIO_LEDS (SBCOMMON_GPIO_DBGLED_0 | \
41 SBCOMMON_GPIO_DBGLED_1 | \
42 SBCOMMON_GPIO_DBGLED_2 | \
43 SBCOMMON_GPIO_DBGLED_3 | \
44 SBCOMMON_GPIO_SYS_STATUS)
46 typedef struct ppc440_gpio_regs {
47 volatile unsigned long out;
48 volatile unsigned long tri_state;
49 volatile unsigned long dummy[4];
50 volatile unsigned long open_drain;
51 volatile unsigned long in;
52 } __attribute__((packed)) ppc440_gpio_regs_t;
54 int sbcommon_get_master(void);
55 int sbcommon_secondary_present(void);
56 unsigned short sbcommon_get_serial_number(void);
57 void sbcommon_fans(void);
58 void board_get_enetaddr(int macaddr_idx, uchar *enet);
60 #endif /* __SBCOMMON_H__ */