blob: 0a1c5fcb82930d0908154ea6d7a4eab5594c8409 [file] [log] [blame]
Stefan Roesee373c5f2009-01-21 17:24:49 +01001/*
2 * (C) Copyright 2008 Stefan Roese <sr@denx.de>, DENX Software Engineering
3 *
4 * Copyright (C) 2006 Micronas GmbH
5 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Stefan Roesee373c5f2009-01-21 17:24:49 +01007 */
8
9#include <asm/io.h>
10
11#include "bcu.h"
12#include "dcgu.h"
13#include "ebi.h"
14#include "scc.h"
15
16#ifdef CONFIG_VCT_PREMIUM
17/* Global start address of all memory mapped registers */
18#define REG_GLOBAL_START_ADDR 0xbf800000
19#define TOP_BASE 0x000c8000
20
21#include "vcth/reg_ebi.h"
22#include "vcth/reg_dcgu.h"
23#include "vcth/reg_wdt.h"
24#include "vcth/reg_gpio.h"
25#include "vcth/reg_fwsram.h"
26#include "vcth/reg_scc.h"
27#include "vcth/reg_usbh.h"
28#endif
29
30#ifdef CONFIG_VCT_PLATINUM
31/* Global start address of all memory mapped registers */
32#define REG_GLOBAL_START_ADDR 0xbf800000
33#define TOP_BASE 0x000c8000
34
35#include "vcth2/reg_ebi.h"
36#include "vcth/reg_dcgu.h"
37#include "vcth/reg_wdt.h"
38#include "vcth/reg_gpio.h"
39#include "vcth/reg_fwsram.h"
40#include "vcth/reg_scc.h"
41#include "vcth/reg_usbh.h"
42#endif
43
44#ifdef CONFIG_VCT_PLATINUMAVC
45/* Global start address of all memory mapped registers */
46#define REG_GLOBAL_START_ADDR 0xbdc00000
47#define TOP_BASE 0x00050000
48
49#include "vctv/reg_ebi.h"
50#include "vctv/reg_dcgu.h"
51#include "vctv/reg_wdt.h"
52#include "vctv/reg_gpio.h"
53#endif
54
55#ifndef _VCT_H
56#define _VCT_H
57
58/*
59 * Defines
60 */
61#define PRID_COMP_LEGACY 0x000000
62#define PRID_COMP_MIPS 0x010000
63#define PRID_IMP_LX4280 0xc200
64#define PRID_IMP_VGC 0x9000
65
66/*
67 * Prototypes
68 */
69int ebi_initialize(void);
70int ebi_init_nor_flash(void);
71int ebi_init_onenand(void);
72int ebi_init_smc911x(void);
73u32 smc911x_reg_read(u32 addr);
74void smc911x_reg_write(u32 addr, u32 data);
75int top_set_pin(int pin, int func);
76void vct_pin_mux_initialize(void);
77
78/*
79 * static inlines
80 */
81static inline void reg_write(u32 addr, u32 data)
82{
83 __raw_writel(data, addr + REG_GLOBAL_START_ADDR);
84}
85
86static inline u32 reg_read(u32 addr)
87{
88 return __raw_readl(addr + REG_GLOBAL_START_ADDR);
89}
90
91#endif /* _VCT_H */