]> git.ipfire.org Git - people/ms/u-boot.git/blame - arch/arm/mach-mvebu/include/mach/cpu.h
Merge branch 'master' of git://git.denx.de/u-boot-video
[people/ms/u-boot.git] / arch / arm / mach-mvebu / include / mach / cpu.h
CommitLineData
41e5ee54
SR
1/*
2 * (C) Copyright 2009
3 * Marvell Semiconductor <www.marvell.com>
4 * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
5 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8
250eea74
SR
9#ifndef _MVEBU_CPU_H
10#define _MVEBU_CPU_H
41e5ee54
SR
11
12#include <asm/system.h>
13
14#ifndef __ASSEMBLY__
15
16#define MVEBU_REG_PCIE_DEVID (MVEBU_REG_PCIE_BASE + 0x00)
17#define MVEBU_REG_PCIE_REVID (MVEBU_REG_PCIE_BASE + 0x08)
18
19enum memory_bank {
20 BANK0,
21 BANK1,
22 BANK2,
23 BANK3
24};
25
26enum cpu_winen {
27 CPU_WIN_DISABLE,
28 CPU_WIN_ENABLE
29};
30
31enum cpu_target {
32 CPU_TARGET_DRAM = 0x0,
33 CPU_TARGET_DEVICEBUS_BOOTROM_SPI = 0x1,
34 CPU_TARGET_ETH23 = 0x3,
35 CPU_TARGET_PCIE02 = 0x4,
36 CPU_TARGET_ETH01 = 0x7,
37 CPU_TARGET_PCIE13 = 0x8,
38 CPU_TARGET_SASRAM = 0x9,
39 CPU_TARGET_NAND = 0xd,
40};
41
42enum cpu_attrib {
43 CPU_ATTR_SASRAM = 0x01,
44 CPU_ATTR_DRAM_CS0 = 0x0e,
45 CPU_ATTR_DRAM_CS1 = 0x0d,
46 CPU_ATTR_DRAM_CS2 = 0x0b,
47 CPU_ATTR_DRAM_CS3 = 0x07,
48 CPU_ATTR_NANDFLASH = 0x2f,
49 CPU_ATTR_SPIFLASH = 0x1e,
50 CPU_ATTR_BOOTROM = 0x1d,
51 CPU_ATTR_PCIE_IO = 0xe0,
52 CPU_ATTR_PCIE_MEM = 0xe8,
53 CPU_ATTR_DEV_CS0 = 0x3e,
54 CPU_ATTR_DEV_CS1 = 0x3d,
55 CPU_ATTR_DEV_CS2 = 0x3b,
56 CPU_ATTR_DEV_CS3 = 0x37,
57};
58
9c6d3b7b
SR
59enum {
60 MVEBU_SOC_AXP,
61 MVEBU_SOC_A38X,
62 MVEBU_SOC_UNKNOWN,
63};
64
41e5ee54
SR
65/*
66 * Default Device Address MAP BAR values
67 */
8ed20d65
SR
68#define MBUS_PCI_MEM_BASE 0xE8000000
69#define MBUS_PCI_MEM_SIZE (128 << 20)
70#define MBUS_PCI_IO_BASE 0xF1100000
71#define MBUS_PCI_IO_SIZE (64 << 10)
72#define MBUS_SPI_BASE 0xF4000000
73#define MBUS_SPI_SIZE (8 << 20)
74#define MBUS_BOOTROM_BASE 0xF8000000
75#define MBUS_BOOTROM_SIZE (8 << 20)
41e5ee54
SR
76
77struct mbus_win {
78 u32 base;
79 u32 size;
80 u8 target;
81 u8 attr;
82};
83
84/*
85 * System registers
86 * Ref: Datasheet sec:A.28
87 */
88struct mvebu_system_registers {
89 u8 pad1[0x60];
90 u32 rstoutn_mask; /* 0x60 */
91 u32 sys_soft_rst; /* 0x64 */
92};
93
94/*
95 * GPIO Registers
96 * Ref: Datasheet sec:A.19
97 */
98struct kwgpio_registers {
99 u32 dout;
100 u32 oe;
101 u32 blink_en;
102 u32 din_pol;
103 u32 din;
104 u32 irq_cause;
105 u32 irq_mask;
106 u32 irq_level;
107};
108
d718bf2c
SR
109struct sar_freq_modes {
110 u8 val;
111 u8 ffc; /* Fabric Frequency Configuration */
112 u32 p_clk;
113 u32 nb_clk;
114 u32 d_clk;
115};
116
e7778ec1
SR
117/* Needed for dynamic (board-specific) mbus configuration */
118extern struct mvebu_mbus_state mbus_state;
119
41e5ee54
SR
120/*
121 * functions
122 */
123unsigned int mvebu_sdram_bar(enum memory_bank bank);
124unsigned int mvebu_sdram_bs(enum memory_bank bank);
125void mvebu_sdram_size_adjust(enum memory_bank bank);
126int mvebu_mbus_probe(struct mbus_win windows[], int count);
9c6d3b7b 127int mvebu_soc_family(void);
2a0b7dc3 128u32 mvebu_get_nand_clock(void);
b0f80b91 129
944c7a31
SR
130void return_to_bootrom(void);
131
7f1adcd7
SR
132int mv_sdh_init(unsigned long regbase, u32 max_clk, u32 min_clk, u32 quirks);
133
d718bf2c
SR
134void get_sar_freq(struct sar_freq_modes *sar_freq);
135
b0f80b91
SR
136/*
137 * Highspeed SERDES PHY config init, ported from bin_hdr
138 * to mainline U-Boot
139 */
140int serdes_phy_config(void);
141
142/*
143 * DDR3 init / training code ported from Marvell bin_hdr. Now
144 * available in mainline U-Boot in:
ff9112df 145 * drivers/ddr/marvell
b0f80b91
SR
146 */
147int ddr3_init(void);
913d1be2
SR
148
149struct mvebu_lcd_info {
150 u32 fb_base;
151 int x_res;
152 int y_res;
153 int x_fp; /* frontporch */
154 int y_fp;
155 int x_bp; /* backporch */
156 int y_bp;
157};
158
159int mvebu_lcd_register_init(struct mvebu_lcd_info *lcd_info);
160
41e5ee54 161#endif /* __ASSEMBLY__ */
250eea74 162#endif /* _MVEBU_CPU_H */