From cac5b1cc0d6daa0c0a037fd24a87d4db4e0a1456 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 26 Nov 2014 00:04:24 +0100 Subject: sunxi: Add sunxi_get_sid helper function On sun6i the SID is stored in the pmic, rather then in the SoC itself, add a helper function to abstract this away. This makes our MAC address generation code also work on sun6i. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- arch/arm/cpu/armv7/sunxi/cpu_info.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'arch/arm/cpu') diff --git a/arch/arm/cpu/armv7/sunxi/cpu_info.c b/arch/arm/cpu/armv7/sunxi/cpu_info.c index 5146dc4..7a3a4ca 100644 --- a/arch/arm/cpu/armv7/sunxi/cpu_info.c +++ b/arch/arm/cpu/armv7/sunxi/cpu_info.c @@ -10,6 +10,7 @@ #include #include #include +#include #ifdef CONFIG_MACH_SUN6I int sunxi_get_ss_bonding_id(void) @@ -72,3 +73,21 @@ int print_cpuinfo(void) return 0; } #endif + +int sunxi_get_sid(unsigned int *sid) +{ +#ifdef CONFIG_MACH_SUN6I +#ifdef CONFIG_AXP221_POWER + return axp221_get_sid(sid); +#else + return -ENODEV; +#endif +#else + int i; + + for (i = 0; i< 4; i++) + sid[i] = readl(SUNXI_SID_BASE + 4 * i); + + return 0; +#endif +} -- cgit v1.1