Commit b70c4207 authored by Arnd Bergmann's avatar Arnd Bergmann
parents 597b97ca 52f3a41e
...@@ -48,7 +48,6 @@ CONFIG_MACH_SX1=y ...@@ -48,7 +48,6 @@ CONFIG_MACH_SX1=y
CONFIG_MACH_NOKIA770=y CONFIG_MACH_NOKIA770=y
CONFIG_MACH_AMS_DELTA=y CONFIG_MACH_AMS_DELTA=y
CONFIG_MACH_OMAP_GENERIC=y CONFIG_MACH_OMAP_GENERIC=y
CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER=y
CONFIG_OMAP_ARM_216MHZ=y CONFIG_OMAP_ARM_216MHZ=y
CONFIG_OMAP_ARM_195MHZ=y CONFIG_OMAP_ARM_195MHZ=y
CONFIG_OMAP_ARM_192MHZ=y CONFIG_OMAP_ARM_192MHZ=y
......
...@@ -171,14 +171,6 @@ config MACH_OMAP_GENERIC ...@@ -171,14 +171,6 @@ config MACH_OMAP_GENERIC
comment "OMAP CPU Speed" comment "OMAP CPU Speed"
depends on ARCH_OMAP1 depends on ARCH_OMAP1
config OMAP_CLOCKS_SET_BY_BOOTLOADER
bool "OMAP clocks set by bootloader"
depends on ARCH_OMAP1
help
Enable this option to prevent the kernel from overriding the clock
frequencies programmed by bootloader for MPU, DSP, MMUs, TC,
internal LCD controller and MPU peripherals.
config OMAP_ARM_216MHZ config OMAP_ARM_216MHZ
bool "OMAP ARM 216 MHz CPU (1710 only)" bool "OMAP ARM 216 MHz CPU (1710 only)"
depends on ARCH_OMAP1 && ARCH_OMAP16XX depends on ARCH_OMAP1 && ARCH_OMAP16XX
......
...@@ -302,8 +302,6 @@ static void __init ams_delta_init(void) ...@@ -302,8 +302,6 @@ static void __init ams_delta_init(void)
omap_cfg_reg(J19_1610_CAM_D6); omap_cfg_reg(J19_1610_CAM_D6);
omap_cfg_reg(J18_1610_CAM_D7); omap_cfg_reg(J18_1610_CAM_D7);
iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc));
omap_board_config = ams_delta_config; omap_board_config = ams_delta_config;
omap_board_config_size = ARRAY_SIZE(ams_delta_config); omap_board_config_size = ARRAY_SIZE(ams_delta_config);
omap_serial_init(); omap_serial_init();
...@@ -373,10 +371,16 @@ static int __init ams_delta_modem_init(void) ...@@ -373,10 +371,16 @@ static int __init ams_delta_modem_init(void)
} }
arch_initcall(ams_delta_modem_init); arch_initcall(ams_delta_modem_init);
static void __init ams_delta_map_io(void)
{
omap15xx_map_io();
iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc));
}
MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)") MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
/* Maintainer: Jonathan McDowell <noodles@earth.li> */ /* Maintainer: Jonathan McDowell <noodles@earth.li> */
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = omap15xx_map_io, .map_io = ams_delta_map_io,
.init_early = omap1_init_early, .init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = omap1_init_irq, .init_irq = omap1_init_irq,
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
#include <plat/clock.h> #include <plat/clock.h>
extern int __init omap1_clk_init(void); int omap1_clk_init(void);
void omap1_clk_late_init(void);
extern int omap1_clk_enable(struct clk *clk); extern int omap1_clk_enable(struct clk *clk);
extern void omap1_clk_disable(struct clk *clk); extern void omap1_clk_disable(struct clk *clk);
extern long omap1_clk_round_rate(struct clk *clk, unsigned long rate); extern long omap1_clk_round_rate(struct clk *clk, unsigned long rate);
......
...@@ -767,6 +767,15 @@ static struct clk_functions omap1_clk_functions = { ...@@ -767,6 +767,15 @@ static struct clk_functions omap1_clk_functions = {
.clk_disable_unused = omap1_clk_disable_unused, .clk_disable_unused = omap1_clk_disable_unused,
}; };
static void __init omap1_show_rates(void)
{
pr_notice("Clocking rate (xtal/DPLL1/MPU): "
"%ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n",
ck_ref.rate / 1000000, (ck_ref.rate / 100000) % 10,
ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10,
arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10);
}
int __init omap1_clk_init(void) int __init omap1_clk_init(void)
{ {
struct omap_clk *c; struct omap_clk *c;
...@@ -835,9 +844,12 @@ int __init omap1_clk_init(void) ...@@ -835,9 +844,12 @@ int __init omap1_clk_init(void)
/* We want to be in syncronous scalable mode */ /* We want to be in syncronous scalable mode */
omap_writew(0x1000, ARM_SYSST); omap_writew(0x1000, ARM_SYSST);
#ifdef CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER
/* Use values set by bootloader. Determine PLL rate and recalculate /*
* dependent clocks as if kernel had changed PLL or divisors. * Initially use the values set by bootloader. Determine PLL rate and
* recalculate dependent clocks as if kernel had changed PLL or
* divisors. See also omap1_clk_late_init() that can reprogram dpll1
* after the SRAM is initialized.
*/ */
{ {
unsigned pll_ctl_val = omap_readw(DPLL_CTL); unsigned pll_ctl_val = omap_readw(DPLL_CTL);
...@@ -862,25 +874,10 @@ int __init omap1_clk_init(void) ...@@ -862,25 +874,10 @@ int __init omap1_clk_init(void)
} }
} }
} }
#else
/* Find the highest supported frequency and enable it */
if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) {
printk(KERN_ERR "System frequencies not set. Check your config.\n");
/* Guess sane values (60MHz) */
omap_writew(0x2290, DPLL_CTL);
omap_writew(cpu_is_omap7xx() ? 0x3005 : 0x1005, ARM_CKCTL);
ck_dpll1.rate = 60000000;
}
#endif
propagate_rate(&ck_dpll1); propagate_rate(&ck_dpll1);
/* Cache rates for clocks connected to ck_ref (not dpll1) */ /* Cache rates for clocks connected to ck_ref (not dpll1) */
propagate_rate(&ck_ref); propagate_rate(&ck_ref);
printk(KERN_INFO "Clocking rate (xtal/DPLL1/MPU): " omap1_show_rates();
"%ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n",
ck_ref.rate / 1000000, (ck_ref.rate / 100000) % 10,
ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10,
arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10);
if (machine_is_omap_perseus2() || machine_is_omap_fsample()) { if (machine_is_omap_perseus2() || machine_is_omap_fsample()) {
/* Select slicer output as OMAP input clock */ /* Select slicer output as OMAP input clock */
omap_writew(omap_readw(OMAP7XX_PCC_UPLD_CTRL) & ~0x1, omap_writew(omap_readw(OMAP7XX_PCC_UPLD_CTRL) & ~0x1,
...@@ -925,3 +922,21 @@ int __init omap1_clk_init(void) ...@@ -925,3 +922,21 @@ int __init omap1_clk_init(void)
return 0; return 0;
} }
#define OMAP1_DPLL1_SANE_VALUE 60000000
void __init omap1_clk_late_init(void)
{
if (ck_dpll1.rate >= OMAP1_DPLL1_SANE_VALUE)
return;
/* Find the highest supported frequency and enable it */
if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) {
pr_err("System frequencies not set, using default. Check your config.\n");
omap_writew(0x2290, DPLL_CTL);
omap_writew(cpu_is_omap7xx() ? 0x3005 : 0x1005, ARM_CKCTL);
ck_dpll1.rate = OMAP1_DPLL1_SANE_VALUE;
}
propagate_rate(&ck_dpll1);
omap1_show_rates();
}
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include <plat/omap7xx.h> #include <plat/omap7xx.h>
#include <plat/mcbsp.h> #include <plat/mcbsp.h>
#include "clock.h"
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
#if defined(CONFIG_RTC_DRV_OMAP) || defined(CONFIG_RTC_DRV_OMAP_MODULE) #if defined(CONFIG_RTC_DRV_OMAP) || defined(CONFIG_RTC_DRV_OMAP_MODULE)
...@@ -293,6 +295,7 @@ static int __init omap1_init_devices(void) ...@@ -293,6 +295,7 @@ static int __init omap1_init_devices(void)
return -ENODEV; return -ENODEV;
omap_sram_init(); omap_sram_init();
omap1_clk_late_init();
/* please keep these calls, and their implementations above, /* please keep these calls, and their implementations above,
* in alphabetical order so they're easier to sort through. * in alphabetical order so they're easier to sort through.
......
...@@ -334,6 +334,7 @@ config MACH_OMAP4_PANDA ...@@ -334,6 +334,7 @@ config MACH_OMAP4_PANDA
config OMAP3_EMU config OMAP3_EMU
bool "OMAP3 debugging peripherals" bool "OMAP3 debugging peripherals"
depends on ARCH_OMAP3 depends on ARCH_OMAP3
select ARM_AMBA
select OC_ETM select OC_ETM
help help
Say Y here to enable debugging hardware of omap3 Say Y here to enable debugging hardware of omap3
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/cpuidle.h> #include <linux/cpuidle.h>
#include <linux/export.h>
#include <plat/prcm.h> #include <plat/prcm.h>
#include <plat/irqs.h> #include <plat/irqs.h>
......
...@@ -749,7 +749,7 @@ static int _count_mpu_irqs(struct omap_hwmod *oh) ...@@ -749,7 +749,7 @@ static int _count_mpu_irqs(struct omap_hwmod *oh)
ohii = &oh->mpu_irqs[i++]; ohii = &oh->mpu_irqs[i++];
} while (ohii->irq != -1); } while (ohii->irq != -1);
return i; return i-1;
} }
/** /**
...@@ -772,7 +772,7 @@ static int _count_sdma_reqs(struct omap_hwmod *oh) ...@@ -772,7 +772,7 @@ static int _count_sdma_reqs(struct omap_hwmod *oh)
ohdi = &oh->sdma_reqs[i++]; ohdi = &oh->sdma_reqs[i++];
} while (ohdi->dma_req != -1); } while (ohdi->dma_req != -1);
return i; return i-1;
} }
/** /**
...@@ -795,7 +795,7 @@ static int _count_ocp_if_addr_spaces(struct omap_hwmod_ocp_if *os) ...@@ -795,7 +795,7 @@ static int _count_ocp_if_addr_spaces(struct omap_hwmod_ocp_if *os)
mem = &os->addr[i++]; mem = &os->addr[i++];
} while (mem->pa_start != mem->pa_end); } while (mem->pa_start != mem->pa_end);
return i; return i-1;
} }
/** /**
......
...@@ -237,7 +237,7 @@ static int __devexit omap4_l3_remove(struct platform_device *pdev) ...@@ -237,7 +237,7 @@ static int __devexit omap4_l3_remove(struct platform_device *pdev)
static const struct of_device_id l3_noc_match[] = { static const struct of_device_id l3_noc_match[] = {
{.compatible = "ti,omap4-l3-noc", }, {.compatible = "ti,omap4-l3-noc", },
{}, {},
} };
MODULE_DEVICE_TABLE(of, l3_noc_match); MODULE_DEVICE_TABLE(of, l3_noc_match);
#else #else
#define l3_noc_match NULL #define l3_noc_match NULL
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "powerdomain.h" #include "powerdomain.h"
#include "clockdomain.h" #include "clockdomain.h"
#include "pm.h" #include "pm.h"
#include "twl-common.h"
static struct omap_device_pm_latency *pm_lats; static struct omap_device_pm_latency *pm_lats;
...@@ -226,11 +227,8 @@ postcore_initcall(omap2_common_pm_init); ...@@ -226,11 +227,8 @@ postcore_initcall(omap2_common_pm_init);
static int __init omap2_common_pm_late_init(void) static int __init omap2_common_pm_late_init(void)
{ {
/* Init the OMAP TWL parameters */
omap3_twl_init();
omap4_twl_init();
/* Init the voltage layer */ /* Init the voltage layer */
omap_pmic_late_init();
omap_voltage_late_init(); omap_voltage_late_init();
/* Initialize the voltages */ /* Initialize the voltages */
......
...@@ -139,7 +139,7 @@ static irqreturn_t sr_interrupt(int irq, void *data) ...@@ -139,7 +139,7 @@ static irqreturn_t sr_interrupt(int irq, void *data)
sr_write_reg(sr_info, ERRCONFIG_V1, status); sr_write_reg(sr_info, ERRCONFIG_V1, status);
} else if (sr_info->ip_type == SR_TYPE_V2) { } else if (sr_info->ip_type == SR_TYPE_V2) {
/* Read the status bits */ /* Read the status bits */
sr_read_reg(sr_info, IRQSTATUS); status = sr_read_reg(sr_info, IRQSTATUS);
/* Clear them by writing back */ /* Clear them by writing back */
sr_write_reg(sr_info, IRQSTATUS, status); sr_write_reg(sr_info, IRQSTATUS, status);
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <plat/usb.h> #include <plat/usb.h>
#include "twl-common.h" #include "twl-common.h"
#include "pm.h"
static struct i2c_board_info __initdata pmic_i2c_board_info = { static struct i2c_board_info __initdata pmic_i2c_board_info = {
.addr = 0x48, .addr = 0x48,
...@@ -48,6 +49,16 @@ void __init omap_pmic_init(int bus, u32 clkrate, ...@@ -48,6 +49,16 @@ void __init omap_pmic_init(int bus, u32 clkrate,
omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1); omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1);
} }
void __init omap_pmic_late_init(void)
{
/* Init the OMAP TWL parameters (if PMIC has been registerd) */
if (!pmic_i2c_board_info.irq)
return;
omap3_twl_init();
omap4_twl_init();
}
#if defined(CONFIG_ARCH_OMAP3) #if defined(CONFIG_ARCH_OMAP3)
static struct twl4030_usb_data omap3_usb_pdata = { static struct twl4030_usb_data omap3_usb_pdata = {
.usb_mode = T2_USB_MODE_ULPI, .usb_mode = T2_USB_MODE_ULPI,
......
#ifndef __OMAP_PMIC_COMMON__ #ifndef __OMAP_PMIC_COMMON__
#define __OMAP_PMIC_COMMON__ #define __OMAP_PMIC_COMMON__
#include <plat/irqs.h>
#define TWL_COMMON_PDATA_USB (1 << 0) #define TWL_COMMON_PDATA_USB (1 << 0)
#define TWL_COMMON_PDATA_BCI (1 << 1) #define TWL_COMMON_PDATA_BCI (1 << 1)
#define TWL_COMMON_PDATA_MADC (1 << 2) #define TWL_COMMON_PDATA_MADC (1 << 2)
...@@ -30,6 +32,7 @@ struct twl4030_platform_data; ...@@ -30,6 +32,7 @@ struct twl4030_platform_data;
void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq,
struct twl4030_platform_data *pmic_data); struct twl4030_platform_data *pmic_data);
void omap_pmic_late_init(void);
static inline void omap2_pmic_init(const char *pmic_type, static inline void omap2_pmic_init(const char *pmic_type,
struct twl4030_platform_data *pmic_data) struct twl4030_platform_data *pmic_data)
......
...@@ -165,8 +165,8 @@ struct dpll_data { ...@@ -165,8 +165,8 @@ struct dpll_data {
u8 auto_recal_bit; u8 auto_recal_bit;
u8 recal_en_bit; u8 recal_en_bit;
u8 recal_st_bit; u8 recal_st_bit;
u8 flags;
# endif # endif
u8 flags;
}; };
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment