]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/include/asm/arch-sunxi/clock_sun4i.h
sunxi: display: Add a few extra register and constant defines
[karo-tx-uboot.git] / arch / arm / include / asm / arch-sunxi / clock_sun4i.h
index 05fbad3e111a59139f5b8106005e1fba9891943a..a7e25f46c825b70026c431afaf481f2ca5c30c8d 100644 (file)
@@ -39,7 +39,7 @@ struct sunxi_ccm_reg {
        u32 apb0_gate;          /* 0x68 apb0 module clock gating */
        u32 apb1_gate;          /* 0x6c apb1 module clock gating */
        u8 res4[0x10];
-       u32 nand_sclk_cfg;      /* 0x80 nand sub clock control */
+       u32 nand0_clk_cfg;      /* 0x80 nand sub clock control */
        u32 ms_sclk_cfg;        /* 0x84 memory stick sub clock control */
        u32 sd0_clk_cfg;        /* 0x88 sd0 clock control */
        u32 sd1_clk_cfg;        /* 0x8c sd1 clock control */
@@ -144,7 +144,16 @@ struct sunxi_ccm_reg {
 
 #define PLL1_CFG_DEFAULT       0xa1005000
 
+#if defined CONFIG_OLD_SUNXI_KERNEL_COMPAT && defined CONFIG_MACH_SUN5I
+/*
+ * Older linux-sunxi-3.4 kernels override our PLL6 setting with 300 MHz,
+ * halving the mbus frequency, so set it to 300 MHz ourselves and base the
+ * mbus divider on that.
+ */
+#define PLL6_CFG_DEFAULT       0xa1009900
+#else
 #define PLL6_CFG_DEFAULT       0xa1009911
+#endif
 
 /* nand clock */
 #define NAND_CLK_SRC_OSC24             0
@@ -168,7 +177,7 @@ struct sunxi_ccm_reg {
 #define AHB_GATE_OFFSET_ACE            16
 #define AHB_GATE_OFFSET_DLL            15
 #define AHB_GATE_OFFSET_SDRAM          14
-#define AHB_GATE_OFFSET_NAND           13
+#define AHB_GATE_OFFSET_NAND0          13
 #define AHB_GATE_OFFSET_MS             12
 #define AHB_GATE_OFFSET_MMC3           11
 #define AHB_GATE_OFFSET_MMC2           10
@@ -258,6 +267,8 @@ struct sunxi_ccm_reg {
 #define CCM_MBUS_CTRL_CLK_SRC_PLL5 0x2
 #define CCM_MBUS_CTRL_GATE (0x1 << 31)
 
+#define CCM_NAND_CTRL_ENABLE           (0x1 << 31)
+
 #define CCM_MMC_CTRL_M(x)              ((x) - 1)
 #define CCM_MMC_CTRL_OCLK_DLY(x)       ((x) << 8)
 #define CCM_MMC_CTRL_N(x)              ((x) << 16)
@@ -280,7 +291,7 @@ struct sunxi_ccm_reg {
 #define CCM_LCD_CH0_CTRL_GATE          (0x1 << 31)
 
 #define CCM_LCD_CH1_CTRL_M(n)          ((((n) - 1) & 0xf) << 0)
-/* We leave bit 11 set to 0, so sclk1 == sclk2 */
+#define CCM_LCD_CH1_CTRL_HALF_SCLK1    (1 << 11)
 #define CCM_LCD_CH1_CTRL_PLL3          (0 << 24)
 #define CCM_LCD_CH1_CTRL_PLL7          (1 << 24)
 #define CCM_LCD_CH1_CTRL_PLL3_2X       (2 << 24)
@@ -305,10 +316,14 @@ struct sunxi_ccm_reg {
 #define CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII 0x2
 #define CCM_GMAC_CTRL_GPIT_MII (0x0 << 2)
 #define CCM_GMAC_CTRL_GPIT_RGMII (0x1 << 2)
+#define CCM_GMAC_CTRL_RX_CLK_DELAY(x)  ((x) << 5)
+#define CCM_GMAC_CTRL_TX_CLK_DELAY(x)  ((x) << 10)
 
 #define CCM_USB_CTRL_PHY0_RST (0x1 << 0)
 #define CCM_USB_CTRL_PHY1_RST (0x1 << 1)
 #define CCM_USB_CTRL_PHY2_RST (0x1 << 2)
+#define CCM_USB_CTRL_OHCI0_CLK (0x1 << 6)
+#define CCM_USB_CTRL_OHCI1_CLK (0x1 << 7)
 #define CCM_USB_CTRL_PHYGATE (0x1 << 8)
 /* These 3 are sun6i only, define them as 0 on sun4i */
 #define CCM_USB_CTRL_PHY0_CLK 0