reg_base = <0xff638800>;
interrupts = <GIC_SPI 51 IRQ_TYPE_EDGE_RISING>;
};
+
+ efuse: efuse{
+ compatible = "amlogic, efuse";
+ read_cmd = <0x82000030>;
+ write_cmd = <0x82000031>;
+ get_max_cmd = <0x82000033>;
+ key = <&efusekey>;
+ clocks = <&clkc CLKID_EFUSE>;
+ clock-names = "efuse_clk";
+ status = "disabled";
+ };
+
+ efusekey:efusekey{
+ keynum = <4>;
+ key0 = <&key_0>;
+ key1 = <&key_1>;
+ key2 = <&key_2>;
+ key3 = <&key_3>;
+ key_0:key_0{
+ keyname = "mac";
+ offset = <0>;
+ size = <6>;
+ };
+ key_1:key_1{
+ keyname = "mac_bt";
+ offset = <6>;
+ size = <6>;
+ };
+ key_2:key_2{
+ keyname = "mac_wifi";
+ offset = <12>;
+ size = <6>;
+ };
+ key_3:key_3{
+ keyname = "usid";
+ offset = <18>;
+ size = <16>;
+ };
+ };
}; /* end of / */
&pinctrl_aobus {
status = "okay";
};
+&efuse {
+ status = "okay";
+};
&pwm_ab {
status = "okay";
};
+
+&efuse {
+ status = "okay";
+};
&pwm_ab {
status = "okay";
};
+
+&efuse {
+ status = "okay";
+};
#
ifneq ($(CONFIG_ARM64),y)
-obj-$(CONFIG_AMLOGIC_EFUSE) += efuse_version.o efuse_hw.o efuse.o
+ ifneq ($(CONFIG_ARM64_A32),y)
+ obj-$(CONFIG_AMLOGIC_EFUSE) += efuse_version.o efuse_hw.o efuse.o
+ else
+ obj-$(CONFIG_AMLOGIC_EFUSE) += efuse_hw64.o efuse64.o
+ endif
else
obj-$(CONFIG_AMLOGIC_EFUSE) += efuse_hw64.o efuse64.o
endif
\ No newline at end of file
};
extern struct efuseinfo_t efuseinfo[];
-#ifndef CONFIG_ARM64
+#if defined(CONFIG_ARM64) || defined(CONFIG_ARM64_A32)
+ssize_t efuse_get_max(void);
+ssize_t efuse_read_usr(char *buf, size_t count, loff_t *ppos);
+ssize_t efuse_write_usr(char *buf, size_t count, loff_t *ppos);
+unsigned long efuse_amlogic_set(char *buf, size_t count);
+#else
int efuse_getinfo_byTitle(unsigned char *name, struct efuseinfo_item_t *info);
int check_if_efused(loff_t pos, size_t count);
int efuse_read_item(char *buf, size_t count, loff_t *ppos);
int efuse_write_item(char *buf, size_t count, loff_t *ppos);
extern int efuse_active_version;
extern struct clk *efuse_clk;
-#else
-
-ssize_t efuse_get_max(void);
-ssize_t efuse_read_usr(char *buf, size_t count, loff_t *ppos);
-ssize_t efuse_write_usr(char *buf, size_t count, loff_t *ppos);
-unsigned long efuse_amlogic_set(char *buf, size_t count);
-
#endif
#endif
#include <linux/amlogic/secmon.h>
#include "efuse.h"
-#ifdef CONFIG_ARM64
+#if defined(CONFIG_ARM64) || defined(CONFIG_ARM64_A32)
#include <linux/amlogic/efuse.h>
#endif
#include <linux/arm-smccc.h>
#include <asm/cacheflush.h>
-static long meson_efuse_fn_smc(struct efuse_hal_api_arg *arg)
+static long meson64_efuse_fn_smc(struct efuse_hal_api_arg *arg)
{
long ret;
unsigned int cmd, offset, size;
return 0;
}
-int meson_trustzone_efuse(struct efuse_hal_api_arg *arg)
+int meson64_trustzone_efuse(struct efuse_hal_api_arg *arg)
{
int ret;
return -1;
set_cpus_allowed_ptr(current, cpumask_of(0));
- ret = meson_efuse_fn_smc(arg);
+ ret = meson64_efuse_fn_smc(arg);
set_cpus_allowed_ptr(current, cpu_all_mask);
return ret;
}
memcpy((void *)sharemem_input_base,
(const void *)pBuffer, nLength);
- __flush_dcache_area(sharemem_input_base, nLength);
+ //__flush_dcache_area(sharemem_input_base, nLength);
asm __volatile__("" : : : "memory");
return ret;
}
-ssize_t meson_trustzone_efuse_get_max(struct efuse_hal_api_arg *arg)
+ssize_t meson64_trustzone_efuse_get_max(struct efuse_hal_api_arg *arg)
{
ssize_t ret;
unsigned int cmd;
arg.cmd = EFUSE_HAL_API_USER_MAX;
set_cpus_allowed_ptr(current, cpumask_of(0));
- ret = meson_trustzone_efuse_get_max(&arg);
+ ret = meson64_trustzone_efuse_get_max(&arg);
set_cpus_allowed_ptr(current, cpu_all_mask);
if (ret == 0) {
arg.size = count;
arg.buffer = (unsigned long)buf;
arg.retcnt = (unsigned long)&retcnt;
- ret = meson_trustzone_efuse(&arg);
+ ret = meson64_trustzone_efuse(&arg);
if (ret == 0) {
*ppos += retcnt;
return retcnt;
arg.buffer = (unsigned long)buf;
arg.retcnt = (unsigned long)&retcnt;
- ret = meson_trustzone_efuse(&arg);
+ ret = meson64_trustzone_efuse(&arg);
if (ret == 0) {
*ppos = retcnt;
return retcnt;
#ifndef __EFUSE_AMLOGIC_H
#define __EFUSE_AMLOGIC_H
-#ifdef CONFIG_ARM64
+#if defined(CONFIG_ARM64) || defined(CONFIG_ARM64_A32)
struct efusekey_info {
char keyname[32];
unsigned int offset;