CLK_OF_DECLARE(emev2_smu_gclk, "renesas,emev2-smu-gclk", emev2_smu_gclk_init);
#include <linux/clk-provider.h>
#include <linux/clkdev.h>
#include <linux/of_address.h>
#define USIAU0_RSTCTRL 0x094
#define USIBU1_RSTCTRL 0x0ac
#define USIBU2_RSTCTRL 0x0b0
#define USIBU3_RSTCTRL 0x0b4
#define IIC0_RSTCTRL 0x0dc
#define IIC1_RSTCTRL 0x0e0
#define STI_RSTCTRL 0x124
static DEFINE_SPINLOCK(lock);
static void __iomem *smu_base;
static void __init emev2_smu_write(unsigned long value, int offs)
BUG_ON(!smu_base || (offs >= PAGE_SIZE));
writel_relaxed(value, smu_base + offs);
static const struct of_device_id smu_id[] __initconst = {
{ .compatible = "renesas,emev2-smu", },
static void __init emev2_smu_init(void)
np = of_find_matching_node(NULL, smu_id);
smu_base = of_iomap(np, 0);
emev2_smu_write(0, STI_CLKSEL);
emev2_smu_write(1, STI_RSTCTRL);
emev2_smu_write(2, USIAU0_RSTCTRL);
emev2_smu_write(2, USIBU1_RSTCTRL);
emev2_smu_write(2, USIBU2_RSTCTRL);
emev2_smu_write(2, USIBU3_RSTCTRL);
emev2_smu_write(1, IIC0_RSTCTRL);
emev2_smu_write(1, IIC1_RSTCTRL);