mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
Merge branch 'axxia/soc' into next/soc
Patches from Anders Berg applied individually: Here is version 4 of platform support for AXM5516 SoC. The clk driver is now applied to clk-next. The rest should be ready for arm-soc. Haven't got any response from the power/reset maintainers... I hope this driver can be taken via arm-soc as well. The AXM55xx family consists of devices that may contain up to 16 ARM Cortex-A15 cores (in a 4x4 cluster configuration). The cores within each cluster share an L2 cache, and the clusters are connected to each other via a CCN-504 cache coherent interconnect. This machine requires CONFIG_ARM_LPAE enabled as all peripherals are located above 4GB in the memory map. * axxia/soc: ARM: dts: axxia: Add reset controller power: reset: Add Axxia system reset driver ARM: axxia: Adding defconfig for AXM55xx ARM: dts: Device tree for AXM55xx. ARM: Add platform support for LSI AXM55xx SoC Signed-off-by: Arnd Bergmann <[email protected]>
This commit is contained in:
commit
650052b141
17 changed files with 1012 additions and 0 deletions
|
|
@ -12,6 +12,14 @@ config POWER_RESET_AS3722
|
|||
help
|
||||
This driver supports turning off board via a ams AS3722 power-off.
|
||||
|
||||
config POWER_RESET_AXXIA
|
||||
bool "LSI Axxia reset driver"
|
||||
depends on POWER_RESET && ARCH_AXXIA
|
||||
help
|
||||
This driver supports restart for Axxia SoC.
|
||||
|
||||
Say Y if you have an Axxia family SoC.
|
||||
|
||||
config POWER_RESET_GPIO
|
||||
bool "GPIO power-off driver"
|
||||
depends on OF_GPIO && POWER_RESET
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
obj-$(CONFIG_POWER_RESET_AS3722) += as3722-poweroff.o
|
||||
obj-$(CONFIG_POWER_RESET_AXXIA) += axxia-reset.o
|
||||
obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o
|
||||
obj-$(CONFIG_POWER_RESET_MSM) += msm-poweroff.o
|
||||
obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o
|
||||
|
|
|
|||
88
drivers/power/reset/axxia-reset.c
Normal file
88
drivers/power/reset/axxia-reset.c
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* Reset driver for Axxia devices
|
||||
*
|
||||
* Copyright (C) 2014 LSI
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
* only version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/reboot.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
#include <asm/system_misc.h>
|
||||
|
||||
|
||||
#define SC_CRIT_WRITE_KEY 0x1000
|
||||
#define SC_LATCH_ON_RESET 0x1004
|
||||
#define SC_RESET_CONTROL 0x1008
|
||||
#define RSTCTL_RST_ZERO (1<<3)
|
||||
#define RSTCTL_RST_FAB (1<<2)
|
||||
#define RSTCTL_RST_CHIP (1<<1)
|
||||
#define RSTCTL_RST_SYS (1<<0)
|
||||
#define SC_EFUSE_INT_STATUS 0x180c
|
||||
#define EFUSE_READ_DONE (1<<31)
|
||||
|
||||
static struct regmap *syscon;
|
||||
|
||||
static void do_axxia_restart(enum reboot_mode reboot_mode, const char *cmd)
|
||||
{
|
||||
/* Access Key (0xab) */
|
||||
regmap_write(syscon, SC_CRIT_WRITE_KEY, 0xab);
|
||||
/* Select internal boot from 0xffff0000 */
|
||||
regmap_write(syscon, SC_LATCH_ON_RESET, 0x00000040);
|
||||
/* Assert ResetReadDone (to avoid hanging in boot ROM) */
|
||||
regmap_write(syscon, SC_EFUSE_INT_STATUS, EFUSE_READ_DONE);
|
||||
/* Assert chip reset */
|
||||
regmap_update_bits(syscon, SC_RESET_CONTROL,
|
||||
RSTCTL_RST_CHIP, RSTCTL_RST_CHIP);
|
||||
}
|
||||
|
||||
static int axxia_reset_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
|
||||
syscon = syscon_regmap_lookup_by_phandle(dev->of_node, "syscon");
|
||||
if (IS_ERR(syscon)) {
|
||||
pr_err("%s: syscon lookup failed\n", dev->of_node->name);
|
||||
return PTR_ERR(syscon);
|
||||
}
|
||||
|
||||
arm_pm_restart = do_axxia_restart;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id of_axxia_reset_match[] = {
|
||||
{ .compatible = "lsi,axm55xx-reset", },
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, of_axxia_reset_match);
|
||||
|
||||
static struct platform_driver axxia_reset_driver = {
|
||||
.probe = axxia_reset_probe,
|
||||
.driver = {
|
||||
.name = "axxia-reset",
|
||||
.of_match_table = of_match_ptr(of_axxia_reset_match),
|
||||
},
|
||||
};
|
||||
|
||||
static int __init axxia_reset_init(void)
|
||||
{
|
||||
return platform_driver_register(&axxia_reset_driver);
|
||||
}
|
||||
device_initcall(axxia_reset_init);
|
||||
Loading…
Reference in a new issue