blob: 67da6a8e730590b2167b2b3e259494baf83d3bae [file] [log] [blame]
Stefan Roeseae691e52009-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 Denk1a459662013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Stefan Roeseae691e52009-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{
Daniel Schwierzeck0c7fd8f2016-01-09 17:32:46 +010083 void *reg = (void *)(addr + REG_GLOBAL_START_ADDR);
84 __raw_writel(data, reg);
Stefan Roeseae691e52009-01-21 17:24:49 +010085}
86
87static inline u32 reg_read(u32 addr)
88{
Daniel Schwierzeck0c7fd8f2016-01-09 17:32:46 +010089 const void *reg = (const void *)(addr + REG_GLOBAL_START_ADDR);
90 return __raw_readl(reg);
Stefan Roeseae691e52009-01-21 17:24:49 +010091}
92
93#endif /* _VCT_H */