OSDN Git Service

arm: kirkwood: Instantiate cpufreq driver
authorAndrew Lunn <andrew@lunn.ch>
Sun, 27 Jan 2013 10:07:23 +0000 (11:07 +0100)
committerJason Cooper <jason@lakedaemon.net>
Wed, 29 May 2013 19:32:04 +0000 (19:32 +0000)
Register a platform driver structure for the cpufreq driver.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Adam Baker <linux@baker-net.org.uk>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
arch/arm/Kconfig
arch/arm/mach-kirkwood/board-dt.c
arch/arm/mach-kirkwood/common.c
arch/arm/mach-kirkwood/common.h
arch/arm/mach-kirkwood/include/mach/bridge-regs.h

index d423d58..76fa766 100644 (file)
@@ -501,6 +501,7 @@ config ARCH_DOVE
 
 config ARCH_KIRKWOOD
        bool "Marvell Kirkwood"
+       select ARCH_HAS_CPUFREQ
        select ARCH_REQUIRE_GPIOLIB
        select CPU_FEROCEON
        select GENERIC_CLOCKEVENTS
index a8dae11..4cc9edf 100644 (file)
@@ -92,6 +92,8 @@ static void __init kirkwood_dt_init(void)
 
        kirkwood_l2_init();
 
+       kirkwood_cpufreq_init();
+
        /* Setup root of clk tree */
        kirkwood_of_clk_init();
 
index c2cae69..97882fc 100644 (file)
@@ -604,6 +604,29 @@ void __init kirkwood_audio_init(void)
 }
 
 /*****************************************************************************
+ * CPU Frequency
+ ****************************************************************************/
+static struct resource kirkwood_cpufreq_resources[] = {
+       [0] = {
+               .start  = CPU_CONTROL_PHYS,
+               .end    = CPU_CONTROL_PHYS + 3,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device kirkwood_cpufreq_device = {
+       .name           = "kirkwood-cpufreq",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(kirkwood_cpufreq_resources),
+       .resource       = kirkwood_cpufreq_resources,
+};
+
+void __init kirkwood_cpufreq_init(void)
+{
+       platform_device_register(&kirkwood_cpufreq_device);
+}
+
+/*****************************************************************************
  * General
  ****************************************************************************/
 /*
index 21da3b1..99e7698 100644 (file)
@@ -51,6 +51,8 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
                            int (*dev_ready)(struct mtd_info *));
 void kirkwood_audio_init(void);
 void kirkwood_cpuidle_init(void);
+void kirkwood_cpufreq_init(void);
+
 void kirkwood_restart(char, const char *);
 void kirkwood_clk_init(void);
 
index 5c82b7d..d4cbe5e 100644 (file)
@@ -17,6 +17,7 @@
 #define CPU_CONFIG_ERROR_PROP  0x00000004
 
 #define CPU_CONTROL            (BRIDGE_VIRT_BASE + 0x0104)
+#define CPU_CONTROL_PHYS       (BRIDGE_PHYS_BASE + 0x0104)
 #define CPU_RESET              0x00000002
 
 #define RSTOUTn_MASK           (BRIDGE_VIRT_BASE + 0x0108)
@@ -69,6 +70,7 @@
 #define CGC_RUNIT              (1 << 7)
 #define CGC_XOR0               (1 << 8)
 #define CGC_AUDIO              (1 << 9)
+#define CGC_POWERSAVE           (1 << 11)
 #define CGC_SATA0              (1 << 14)
 #define CGC_SATA1              (1 << 15)
 #define CGC_XOR1               (1 << 16)