Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 1 | #ifndef __SBCOMMON_H__ |
| 2 | #define __SBCOMMON_H__ |
| 3 | /* |
| 4 | * Copyright (C) 2005 Sandburst Corporation |
| 5 | * |
Wolfgang Denk | 3765b3e | 2013-10-07 13:07:26 +0200 | [diff] [blame^] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 7 | */ |
| 8 | #include <config.h> |
| 9 | #include <common.h> |
| 10 | #include <command.h> |
| 11 | #include <asm/processor.h> |
| 12 | #include <asm/io.h> |
| 13 | #include <spd_sdram.h> |
| 14 | #include <i2c.h> |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 15 | |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 16 | /* |
| 17 | * GPIO Settings |
| 18 | */ |
| 19 | /* Chassis settings */ |
Wolfgang Denk | 3d078ce | 2005-08-15 16:03:56 +0200 | [diff] [blame] | 20 | #define SBCOMMON_GPIO_PRI_N 0x00001000 /* 0 = Chassis Master, 1 = Slave */ |
| 21 | #define SBCOMMON_GPIO_SEC_PRES 0x00000800 /* 1 = Other board present */ |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 22 | |
| 23 | /* Debug LEDs */ |
Wolfgang Denk | 3d078ce | 2005-08-15 16:03:56 +0200 | [diff] [blame] | 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 |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 28 | |
Wolfgang Denk | 3d078ce | 2005-08-15 16:03:56 +0200 | [diff] [blame] | 29 | #define SBCOMMON_GPIO_DBGLEDS (SBCOMMON_GPIO_DBGLED_0 | \ |
| 30 | SBCOMMON_GPIO_DBGLED_1 | \ |
| 31 | SBCOMMON_GPIO_DBGLED_2 | \ |
| 32 | SBCOMMON_GPIO_DBGLED_3) |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 33 | |
Wolfgang Denk | 3d078ce | 2005-08-15 16:03:56 +0200 | [diff] [blame] | 34 | #define SBCOMMON_GPIO_SYS_FAULT 0x00000080 |
| 35 | #define SBCOMMON_GPIO_SYS_OTEMP 0x00000040 |
| 36 | #define SBCOMMON_GPIO_SYS_STATUS 0x00000020 |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 37 | |
Wolfgang Denk | 3d078ce | 2005-08-15 16:03:56 +0200 | [diff] [blame] | 38 | #define SBCOMMON_GPIO_SYS_LEDS (SBCOMMON_GPIO_SYS_STATUS) |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 39 | |
Wolfgang Denk | 3d078ce | 2005-08-15 16:03:56 +0200 | [diff] [blame] | 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) |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 45 | |
| 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; |
| 53 | |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 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); |
Mike Frysinger | d8d21e6 | 2009-02-16 18:03:14 -0500 | [diff] [blame] | 58 | void board_get_enetaddr(int macaddr_idx, uchar *enet); |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 59 | |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 60 | #endif /* __SBCOMMON_H__ */ |