0001
0002
0003
0004
0005
0006 #include <linux/amba/bus.h>
0007 #include <linux/clocksource.h>
0008 #include <linux/dma-mapping.h>
0009 #include <linux/io.h>
0010 #include <linux/irqchip.h>
0011 #include <linux/irqchip/arm-gic.h>
0012 #include <linux/mfd/syscon.h>
0013 #include <linux/of.h>
0014 #include <linux/of_address.h>
0015 #include <linux/clk-provider.h>
0016 #include <linux/regmap.h>
0017 #include <linux/smp.h>
0018 #include <asm/smp_scu.h>
0019 #include <asm/mach/arch.h>
0020 #include <asm/mach/map.h>
0021 #include <asm/psci.h>
0022 #include <linux/arm-smccc.h>
0023
0024
0025 #define ARTPEC6_DMACFG_REGNUM 0x10
0026 #define ARTPEC6_DMACFG_UARTS_BURST 0xff
0027
0028 #define SECURE_OP_L2C_WRITEREG 0xb4000001
0029
0030 static void __init artpec6_init_machine(void)
0031 {
0032 struct regmap *regmap;
0033
0034 regmap = syscon_regmap_lookup_by_compatible("axis,artpec6-syscon");
0035
0036 if (!IS_ERR(regmap)) {
0037
0038
0039
0040 regmap_write(regmap, ARTPEC6_DMACFG_REGNUM,
0041 ARTPEC6_DMACFG_UARTS_BURST);
0042 };
0043 }
0044
0045 static void artpec6_l2c310_write_sec(unsigned long val, unsigned reg)
0046 {
0047 struct arm_smccc_res res;
0048
0049 arm_smccc_smc(SECURE_OP_L2C_WRITEREG, reg, val, 0,
0050 0, 0, 0, 0, &res);
0051
0052 WARN_ON(res.a0);
0053 }
0054
0055 static const char * const artpec6_dt_match[] = {
0056 "axis,artpec6",
0057 NULL
0058 };
0059
0060 DT_MACHINE_START(ARTPEC6, "Axis ARTPEC-6 Platform")
0061 .l2c_aux_val = 0x0C000000,
0062 .l2c_aux_mask = 0xF3FFFFFF,
0063 .l2c_write_sec = artpec6_l2c310_write_sec,
0064 .init_machine = artpec6_init_machine,
0065 .dt_compat = artpec6_dt_match,
0066 MACHINE_END