Stefan Roese | e373c5f | 2009-01-21 17:24:49 +0100 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2008 Stefan Roese <sr@denx.de>, DENX Software Engineering |
| 3 | * |
| 4 | * Copyright (C) 2006 Micronas GmbH |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation; either version 2 of |
| 9 | * the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 19 | * MA 02111-1307 USA |
| 20 | */ |
| 21 | |
| 22 | #include <asm/io.h> |
| 23 | |
| 24 | #include "bcu.h" |
| 25 | #include "dcgu.h" |
| 26 | #include "ebi.h" |
| 27 | #include "scc.h" |
| 28 | |
| 29 | #ifdef CONFIG_VCT_PREMIUM |
| 30 | /* Global start address of all memory mapped registers */ |
| 31 | #define REG_GLOBAL_START_ADDR 0xbf800000 |
| 32 | #define TOP_BASE 0x000c8000 |
| 33 | |
| 34 | #include "vcth/reg_ebi.h" |
| 35 | #include "vcth/reg_dcgu.h" |
| 36 | #include "vcth/reg_wdt.h" |
| 37 | #include "vcth/reg_gpio.h" |
| 38 | #include "vcth/reg_fwsram.h" |
| 39 | #include "vcth/reg_scc.h" |
| 40 | #include "vcth/reg_usbh.h" |
| 41 | #endif |
| 42 | |
| 43 | #ifdef CONFIG_VCT_PLATINUM |
| 44 | /* Global start address of all memory mapped registers */ |
| 45 | #define REG_GLOBAL_START_ADDR 0xbf800000 |
| 46 | #define TOP_BASE 0x000c8000 |
| 47 | |
| 48 | #include "vcth2/reg_ebi.h" |
| 49 | #include "vcth/reg_dcgu.h" |
| 50 | #include "vcth/reg_wdt.h" |
| 51 | #include "vcth/reg_gpio.h" |
| 52 | #include "vcth/reg_fwsram.h" |
| 53 | #include "vcth/reg_scc.h" |
| 54 | #include "vcth/reg_usbh.h" |
| 55 | #endif |
| 56 | |
| 57 | #ifdef CONFIG_VCT_PLATINUMAVC |
| 58 | /* Global start address of all memory mapped registers */ |
| 59 | #define REG_GLOBAL_START_ADDR 0xbdc00000 |
| 60 | #define TOP_BASE 0x00050000 |
| 61 | |
| 62 | #include "vctv/reg_ebi.h" |
| 63 | #include "vctv/reg_dcgu.h" |
| 64 | #include "vctv/reg_wdt.h" |
| 65 | #include "vctv/reg_gpio.h" |
| 66 | #endif |
| 67 | |
| 68 | #ifndef _VCT_H |
| 69 | #define _VCT_H |
| 70 | |
| 71 | /* |
| 72 | * Defines |
| 73 | */ |
| 74 | #define PRID_COMP_LEGACY 0x000000 |
| 75 | #define PRID_COMP_MIPS 0x010000 |
| 76 | #define PRID_IMP_LX4280 0xc200 |
| 77 | #define PRID_IMP_VGC 0x9000 |
| 78 | |
| 79 | /* |
| 80 | * Prototypes |
| 81 | */ |
| 82 | int ebi_initialize(void); |
| 83 | int ebi_init_nor_flash(void); |
| 84 | int ebi_init_onenand(void); |
| 85 | int ebi_init_smc911x(void); |
| 86 | u32 smc911x_reg_read(u32 addr); |
| 87 | void smc911x_reg_write(u32 addr, u32 data); |
| 88 | int top_set_pin(int pin, int func); |
| 89 | void vct_pin_mux_initialize(void); |
| 90 | |
| 91 | /* |
| 92 | * static inlines |
| 93 | */ |
| 94 | static inline void reg_write(u32 addr, u32 data) |
| 95 | { |
| 96 | __raw_writel(data, addr + REG_GLOBAL_START_ADDR); |
| 97 | } |
| 98 | |
| 99 | static inline u32 reg_read(u32 addr) |
| 100 | { |
| 101 | return __raw_readl(addr + REG_GLOBAL_START_ADDR); |
| 102 | } |
| 103 | |
| 104 | #endif /* _VCT_H */ |