14 #define pr_fmt(fmt) "SPEAr1340: " fmt
24 #include <mach/generic.h>
25 #include <mach/spear.h>
28 #define SPEAR1340_SATA_BASE UL(0xB1000000)
29 #define SPEAR1340_UART1_BASE UL(0xB4100000)
32 #define SPEAR1340_PCM_CFG (VA_MISC_BASE + 0x100)
33 #define SPEAR1340_PCM_WKUP_CFG (VA_MISC_BASE + 0x104)
34 #define SPEAR1340_SWITCH_CTR (VA_MISC_BASE + 0x108)
36 #define SPEAR1340_PERIP1_SW_RST (VA_MISC_BASE + 0x318)
37 #define SPEAR1340_PERIP2_SW_RST (VA_MISC_BASE + 0x31C)
38 #define SPEAR1340_PERIP3_SW_RST (VA_MISC_BASE + 0x320)
41 #define SPEAR1340_PCIE_SATA_CFG (VA_MISC_BASE + 0x424)
43 #define SPEAR1340_PCIE_CFG_DEVICE_PRESENT (1 << 11)
44 #define SPEAR1340_PCIE_CFG_POWERUP_RESET (1 << 10)
45 #define SPEAR1340_PCIE_CFG_CORE_CLK_EN (1 << 9)
46 #define SPEAR1340_PCIE_CFG_AUX_CLK_EN (1 << 8)
47 #define SPEAR1340_SATA_CFG_TX_CLK_EN (1 << 4)
48 #define SPEAR1340_SATA_CFG_RX_CLK_EN (1 << 3)
49 #define SPEAR1340_SATA_CFG_POWERUP_RESET (1 << 2)
50 #define SPEAR1340_SATA_CFG_PM_CLK_EN (1 << 1)
51 #define SPEAR1340_PCIE_SATA_SEL_PCIE (0)
52 #define SPEAR1340_PCIE_SATA_SEL_SATA (1)
53 #define SPEAR1340_SATA_PCIE_CFG_MASK 0xF1F
54 #define SPEAR1340_PCIE_CFG_VAL (SPEAR1340_PCIE_SATA_SEL_PCIE | \
55 SPEAR1340_PCIE_CFG_AUX_CLK_EN | \
56 SPEAR1340_PCIE_CFG_CORE_CLK_EN | \
57 SPEAR1340_PCIE_CFG_POWERUP_RESET | \
58 SPEAR1340_PCIE_CFG_DEVICE_PRESENT)
59 #define SPEAR1340_SATA_CFG_VAL (SPEAR1340_PCIE_SATA_SEL_SATA | \
60 SPEAR1340_SATA_CFG_PM_CLK_EN | \
61 SPEAR1340_SATA_CFG_POWERUP_RESET | \
62 SPEAR1340_SATA_CFG_RX_CLK_EN | \
63 SPEAR1340_SATA_CFG_TX_CLK_EN)
65 #define SPEAR1340_PCIE_MIPHY_CFG (VA_MISC_BASE + 0x428)
66 #define SPEAR1340_MIPHY_OSC_BYPASS_EXT (1 << 31)
67 #define SPEAR1340_MIPHY_CLK_REF_DIV2 (1 << 27)
68 #define SPEAR1340_MIPHY_CLK_REF_DIV4 (2 << 27)
69 #define SPEAR1340_MIPHY_CLK_REF_DIV8 (3 << 27)
70 #define SPEAR1340_MIPHY_PLL_RATIO_TOP(x) (x << 0)
71 #define SPEAR1340_PCIE_SATA_MIPHY_CFG_SATA \
72 (SPEAR1340_MIPHY_OSC_BYPASS_EXT | \
73 SPEAR1340_MIPHY_CLK_REF_DIV2 | \
74 SPEAR1340_MIPHY_PLL_RATIO_TOP(60))
75 #define SPEAR1340_PCIE_SATA_MIPHY_CFG_SATA_25M_CRYSTAL_CLK \
76 (SPEAR1340_MIPHY_PLL_RATIO_TOP(120))
77 #define SPEAR1340_PCIE_SATA_MIPHY_CFG_PCIE \
78 (SPEAR1340_MIPHY_OSC_BYPASS_EXT | \
79 SPEAR1340_MIPHY_PLL_RATIO_TOP(25))
87 .dst_master = SPEAR1340_DMA_MASTER_UART1,
92 .src_master = SPEAR1340_DMA_MASTER_UART1,
99 .dma_tx_param = &uart1_dma_param[0],
100 .dma_rx_param = &uart1_dma_param[1],
149 return sata_miphy_init(dev,
NULL);
153 .init = sata_miphy_init,
160 static struct of_dev_auxdata spear1340_auxdata_lookup[]
__initdata = {
172 static void __init spear1340_dt_init(
void)
175 spear1340_auxdata_lookup,
NULL);
178 static const char *
const spear1340_dt_board_compat[] = {
184 DT_MACHINE_START(SPEAR1340_DT,
"ST SPEAr1340 SoC with Flattened Device Tree")
190 .init_machine = spear1340_dt_init,
192 .dt_compat = spear1340_dt_board_compat,