mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
ARM: SoC platform changes for 3.18
New and updated SoC support. Among the things new for this release are:
- at91: Added support for the new SAMA5D4 SoC, following the earlier SAMA5D3
- bcm: Added support for BCM63XX family of DSL SoCs
- hisi: Added support for HiP04 server-class SoC
- meson: Initial support for the Amlogic Meson6 (aka 8726MX) platform
- shmobile: added support for new r8a7794 (R-Car E2) automotive SoC
Noteworthy changes to existing SoC support are:
- imx: convert i.MX1 to device tree
- omap: lots of power management work
- omap: base support to enable moving to standard UART driver
- shmobile: lots of progress for multiplatform support, still ongoing
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIVAwUAVDWVHWCrR//JCVInAQJQVw/+NEfKWh6blDvLEWHpkmBtzdsT3s+r1wwb
ATtvd1Q7RlOMEbzxc2J87tJ44yHb64mSPBbC4BCGuQsM5IIvM4potmBphl/XxLfd
b8PNcI6nvLO+FZOcgon0JWmvVnt+vLGKPUWzURXSRjdrpVRg2qyRpW+nPBnvX4HP
qyzlSskkYzKm7WJQrIV1K3yYwRLrVZdz4DuF340mSFy+4H+uci2Fw91HJ9lKKmPS
24Klx2Q4n6wfg946WazWtz21HjEBuMzRCq0CGZrwcTJffRyMxa4iq/kqE3xGbPtN
onuP1gmAM7UOMewEvc1ZLycY7JyZ3mhKnKduqS/QN2JLLQEY2v1iYFnEKP8mHnnw
ax6RVi91PC2MSLZyPcRtsegSKB9l16I7H+C5pgTOMgsSaqxSG1JtV1qZl3uwhBnE
GB45KHPvTFojrH2+CqneNTLET1ozKgwtuHkWTG61/puYeap/VlpRU2OWj2mQF2E0
SiBzmlbUBpSqzjFgVGD4ywKAuVA/WpJtaOB7Qg26GL2QoNKrY/wsUCY8hU742+jE
b/N6obGcpmjytLkFRHx+AbYc75DHXkPtF4CWawDeQFW30LUeixZJqewQ61a56QF8
49DbO6J+sR0n3xlteD49QdQJzDCtKw3BV+VQaFRcxqVDq4LJAxtUHJZ7c3iyvzEi
6Yt+PsqSP7Y=
=ZHtj
-----END PGP SIGNATURE-----
Merge tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC platform changes from Arnd Bergmann:
"New and updated SoC support. Among the things new for this release
are:
- at91: Added support for the new SAMA5D4 SoC, following the earlier
SAMA5D3
- bcm: Added support for BCM63XX family of DSL SoCs
- hisi: Added support for HiP04 server-class SoC
- meson: Initial support for the Amlogic Meson6 (aka 8726MX) platform
- shmobile: added support for new r8a7794 (R-Car E2) automotive SoC
Noteworthy changes to existing SoC support are:
- imx: convert i.MX1 to device tree
- omap: lots of power management work
- omap: base support to enable moving to standard UART driver
- shmobile: lots of progress for multiplatform support, still
ongoing"
* tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (171 commits)
ARM: hisi: depend on ARCH_MULTI_V7
CNS3xxx: Fix debug UART.
ARM: at91: fix nommu build regression
ARM: meson: add basic support for MesonX SoCs
ARM: meson: debug: add debug UART for earlyprintk support
irq: Export handle_fasteoi_irq
ARM: mediatek: Add earlyprintk support for mt6589
ARM: hisi: Fix platmcpm compilation when ARMv6 is selected
ARM: debug: fix alphanumerical order on debug uarts
ARM: at91: document Atmel SMART compatibles
ARM: at91: add sama5d4 support to sama5_defconfig
ARM: at91: dt: add device tree file for SAMA5D4ek board
ARM: at91: dt: add device tree file for SAMA5D4 SoC
ARM: at91: SAMA5D4 SoC detection code and low level routines
ARM: at91: introduce basic SAMA5D4 support
clk: at91: add a driver for the h32mx clock
ARM: pxa3xx: provide specific platform_devices for all ssp ports
ARM: pxa: ssp: provide platform_device_id for PXA3xx
ARM: OMAP4+: Remove static iotable mappings for SRAM
ARM: OMAP4+: Move SRAM data to DT
...
This commit is contained in:
commit
cf377ad7d4
181 changed files with 5355 additions and 1576 deletions
|
|
@ -9,3 +9,4 @@ obj-y += clk-system.o clk-peripheral.o clk-programmable.o
|
|||
obj-$(CONFIG_HAVE_AT91_UTMI) += clk-utmi.o
|
||||
obj-$(CONFIG_HAVE_AT91_USB_CLK) += clk-usb.o
|
||||
obj-$(CONFIG_HAVE_AT91_SMD) += clk-smd.o
|
||||
obj-$(CONFIG_HAVE_AT91_H32MX) += clk-h32mx.o
|
||||
|
|
|
|||
123
drivers/clk/at91/clk-h32mx.c
Normal file
123
drivers/clk/at91/clk-h32mx.c
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
/*
|
||||
* clk-h32mx.c
|
||||
*
|
||||
* Copyright (C) 2014 Atmel
|
||||
*
|
||||
* Alexandre Belloni <alexandre.belloni@free-electrons.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/clkdev.h>
|
||||
#include <linux/clk/at91_pmc.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/wait.h>
|
||||
|
||||
#include "pmc.h"
|
||||
|
||||
#define H32MX_MAX_FREQ 90000000
|
||||
|
||||
struct clk_sama5d4_h32mx {
|
||||
struct clk_hw hw;
|
||||
struct at91_pmc *pmc;
|
||||
};
|
||||
|
||||
#define to_clk_sama5d4_h32mx(hw) container_of(hw, struct clk_sama5d4_h32mx, hw)
|
||||
|
||||
static unsigned long clk_sama5d4_h32mx_recalc_rate(struct clk_hw *hw,
|
||||
unsigned long parent_rate)
|
||||
{
|
||||
struct clk_sama5d4_h32mx *h32mxclk = to_clk_sama5d4_h32mx(hw);
|
||||
|
||||
if (pmc_read(h32mxclk->pmc, AT91_PMC_MCKR) & AT91_PMC_H32MXDIV)
|
||||
return parent_rate / 2;
|
||||
|
||||
if (parent_rate > H32MX_MAX_FREQ)
|
||||
pr_warn("H32MX clock is too fast\n");
|
||||
return parent_rate;
|
||||
}
|
||||
|
||||
static long clk_sama5d4_h32mx_round_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long *parent_rate)
|
||||
{
|
||||
unsigned long div;
|
||||
|
||||
if (rate > *parent_rate)
|
||||
return *parent_rate;
|
||||
div = *parent_rate / 2;
|
||||
if (rate < div)
|
||||
return div;
|
||||
|
||||
if (rate - div < *parent_rate - rate)
|
||||
return div;
|
||||
|
||||
return *parent_rate;
|
||||
}
|
||||
|
||||
static int clk_sama5d4_h32mx_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long parent_rate)
|
||||
{
|
||||
struct clk_sama5d4_h32mx *h32mxclk = to_clk_sama5d4_h32mx(hw);
|
||||
struct at91_pmc *pmc = h32mxclk->pmc;
|
||||
u32 tmp;
|
||||
|
||||
if (parent_rate != rate && (parent_rate / 2) != rate)
|
||||
return -EINVAL;
|
||||
|
||||
pmc_lock(pmc);
|
||||
tmp = pmc_read(pmc, AT91_PMC_MCKR) & ~AT91_PMC_H32MXDIV;
|
||||
if ((parent_rate / 2) == rate)
|
||||
tmp |= AT91_PMC_H32MXDIV;
|
||||
pmc_write(pmc, AT91_PMC_MCKR, tmp);
|
||||
pmc_unlock(pmc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct clk_ops h32mx_ops = {
|
||||
.recalc_rate = clk_sama5d4_h32mx_recalc_rate,
|
||||
.round_rate = clk_sama5d4_h32mx_round_rate,
|
||||
.set_rate = clk_sama5d4_h32mx_set_rate,
|
||||
};
|
||||
|
||||
void __init of_sama5d4_clk_h32mx_setup(struct device_node *np,
|
||||
struct at91_pmc *pmc)
|
||||
{
|
||||
struct clk_sama5d4_h32mx *h32mxclk;
|
||||
struct clk_init_data init;
|
||||
const char *parent_name;
|
||||
struct clk *clk;
|
||||
|
||||
h32mxclk = kzalloc(sizeof(*h32mxclk), GFP_KERNEL);
|
||||
if (!h32mxclk)
|
||||
return;
|
||||
|
||||
parent_name = of_clk_get_parent_name(np, 0);
|
||||
|
||||
init.name = np->name;
|
||||
init.ops = &h32mx_ops;
|
||||
init.parent_names = parent_name ? &parent_name : NULL;
|
||||
init.num_parents = parent_name ? 1 : 0;
|
||||
init.flags = CLK_SET_RATE_GATE;
|
||||
|
||||
h32mxclk->hw.init = &init;
|
||||
h32mxclk->pmc = pmc;
|
||||
|
||||
clk = clk_register(NULL, &h32mxclk->hw);
|
||||
if (!clk)
|
||||
return;
|
||||
|
||||
of_clk_add_provider(np, of_clk_src_simple_get, clk);
|
||||
}
|
||||
|
|
@ -336,6 +336,12 @@ static const struct of_device_id pmc_clk_ids[] __initconst = {
|
|||
.compatible = "atmel,at91sam9x5-clk-smd",
|
||||
.data = of_at91sam9x5_clk_smd_setup,
|
||||
},
|
||||
#endif
|
||||
#if defined(CONFIG_HAVE_AT91_H32MX)
|
||||
{
|
||||
.compatible = "atmel,sama5d4-clk-h32mx",
|
||||
.data = of_sama5d4_clk_h32mx_setup,
|
||||
},
|
||||
#endif
|
||||
{ /*sentinel*/ }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -120,4 +120,9 @@ extern void __init of_at91sam9x5_clk_smd_setup(struct device_node *np,
|
|||
struct at91_pmc *pmc);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_HAVE_AT91_SMD)
|
||||
extern void __init of_sama5d4_clk_h32mx_setup(struct device_node *np,
|
||||
struct at91_pmc *pmc);
|
||||
#endif
|
||||
|
||||
#endif /* __PMC_H_ */
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ obj-$(CONFIG_ARCH_R8A7740) += clk-r8a7740.o
|
|||
obj-$(CONFIG_ARCH_R8A7779) += clk-r8a7779.o
|
||||
obj-$(CONFIG_ARCH_R8A7790) += clk-rcar-gen2.o
|
||||
obj-$(CONFIG_ARCH_R8A7791) += clk-rcar-gen2.o
|
||||
obj-$(CONFIG_ARCH_R8A7794) += clk-rcar-gen2.o
|
||||
obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-div6.o
|
||||
obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-mstp.o
|
||||
# for emply built-in.o
|
||||
|
|
|
|||
Loading…
Reference in a new issue