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 | * |
| 6 | * See file CREDITS for list of people who contributed to this |
| 7 | * project. |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License as |
| 11 | * published by the Free Software Foundation; either version 2 of |
| 12 | * the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 22 | * MA 02111-1307 USA |
| 23 | */ |
| 24 | #include <config.h> |
| 25 | #include <common.h> |
| 26 | #include <command.h> |
| 27 | #include <asm/processor.h> |
| 28 | #include <asm/io.h> |
| 29 | #include <spd_sdram.h> |
| 30 | #include <i2c.h> |
| 31 | #include "ppc440gx_i2c.h" |
| 32 | |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 33 | /* |
| 34 | * GPIO Settings |
| 35 | */ |
| 36 | /* Chassis settings */ |
Wolfgang Denk | 3d078ce | 2005-08-15 16:03:56 +0200 | [diff] [blame] | 37 | #define SBCOMMON_GPIO_PRI_N 0x00001000 /* 0 = Chassis Master, 1 = Slave */ |
| 38 | #define SBCOMMON_GPIO_SEC_PRES 0x00000800 /* 1 = Other board present */ |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 39 | |
| 40 | /* Debug LEDs */ |
Wolfgang Denk | 3d078ce | 2005-08-15 16:03:56 +0200 | [diff] [blame] | 41 | #define SBCOMMON_GPIO_DBGLED_0 0x00000400 |
| 42 | #define SBCOMMON_GPIO_DBGLED_1 0x00000200 |
| 43 | #define SBCOMMON_GPIO_DBGLED_2 0x00100000 |
| 44 | #define SBCOMMON_GPIO_DBGLED_3 0x00000100 |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 45 | |
Wolfgang Denk | 3d078ce | 2005-08-15 16:03:56 +0200 | [diff] [blame] | 46 | #define SBCOMMON_GPIO_DBGLEDS (SBCOMMON_GPIO_DBGLED_0 | \ |
| 47 | SBCOMMON_GPIO_DBGLED_1 | \ |
| 48 | SBCOMMON_GPIO_DBGLED_2 | \ |
| 49 | SBCOMMON_GPIO_DBGLED_3) |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 50 | |
Wolfgang Denk | 3d078ce | 2005-08-15 16:03:56 +0200 | [diff] [blame] | 51 | #define SBCOMMON_GPIO_SYS_FAULT 0x00000080 |
| 52 | #define SBCOMMON_GPIO_SYS_OTEMP 0x00000040 |
| 53 | #define SBCOMMON_GPIO_SYS_STATUS 0x00000020 |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 54 | |
Wolfgang Denk | 3d078ce | 2005-08-15 16:03:56 +0200 | [diff] [blame] | 55 | #define SBCOMMON_GPIO_SYS_LEDS (SBCOMMON_GPIO_SYS_STATUS) |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 56 | |
Wolfgang Denk | 3d078ce | 2005-08-15 16:03:56 +0200 | [diff] [blame] | 57 | #define SBCOMMON_GPIO_LEDS (SBCOMMON_GPIO_DBGLED_0 | \ |
| 58 | SBCOMMON_GPIO_DBGLED_1 | \ |
| 59 | SBCOMMON_GPIO_DBGLED_2 | \ |
| 60 | SBCOMMON_GPIO_DBGLED_3 | \ |
| 61 | SBCOMMON_GPIO_SYS_STATUS) |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 62 | |
| 63 | typedef struct ppc440_gpio_regs { |
| 64 | volatile unsigned long out; |
| 65 | volatile unsigned long tri_state; |
| 66 | volatile unsigned long dummy[4]; |
| 67 | volatile unsigned long open_drain; |
| 68 | volatile unsigned long in; |
| 69 | } __attribute__((packed)) ppc440_gpio_regs_t; |
| 70 | |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 71 | int sbcommon_get_master(void); |
| 72 | int sbcommon_secondary_present(void); |
| 73 | unsigned short sbcommon_get_serial_number(void); |
| 74 | void sbcommon_fans(void); |
Mike Frysinger | d8d21e6 | 2009-02-16 18:03:14 -0500 | [diff] [blame] | 75 | void board_get_enetaddr(int macaddr_idx, uchar *enet); |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 76 | |
Stefan Roese | b79316f | 2005-08-15 12:31:23 +0200 | [diff] [blame] | 77 | #endif /* __SBCOMMON_H__ */ |