smartcard: s5 5.15 bring up. [1/1]

PD#SWPL-108772

Problem:
s5 5.15 bring up.

Solution:
s5 5.15 bring up.

Verify:
AX201/S928X

Change-Id: If2f1a08cc22aa11db4cf8928185857b8e05be1fa
Signed-off-by: hongyu.chen <hongyu.chen@amlogic.com>
This commit is contained in:
hongyu.chen
2023-04-10 15:14:32 +08:00
committed by gerrit autosubmit
parent 593bd09ddf
commit 0509fe5ecd
12 changed files with 90 additions and 86 deletions
+2 -2
View File
@@ -3354,8 +3354,8 @@
sd_iso7816_pins:sd_iso7816_pins {
mux {
groups = "iso7816_clk_z",
"iso7816_data_z";
groups = "iso7816_clk_t",
"iso7816_data_t";
function = "iso7816";
input-enable;
bias-pull-down;
@@ -775,7 +775,7 @@
multi_core1 = <1>;
};
/* SMC */
/* SMC */
smartcard {
compatible = "amlogic,smartcard-sc2";
dev_name = "smartcard";
@@ -784,12 +784,12 @@
reg = <0x0 0xfe000000 0x0 0x480000>;
irq_trigger_type = "GPIO_IRQ_LOW";
reset_pin-gpios = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_11 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_12 GPIO_ACTIVE_HIGH>;
reset_pin-gpios = <&gpio GPIOT_19 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOT_23 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_22 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_18 GPIO_ACTIVE_HIGH>;
interrupts = <0 174 1>;
interrupts = <0 81 1>;
interrupt-names = "smc0_irq";
/*
*Smc clock source, if change this,
@@ -806,8 +806,8 @@
pinctrl-names = "default";
pinctrl-0 = <&sd_iso7816_pins>;
// clocks = <&clkc CLKID_SC_CLK_GATE>;
// clock-names = "smartcard";
clocks = <&clkc CLKID_SYS_CLK_SMART_CARD>;
clock-names = "smartcard";
};
dvb-extern {
@@ -773,7 +773,7 @@
multi_core1 = <1>;
};
/* SMC */
/* SMC */
smartcard {
compatible = "amlogic,smartcard-sc2";
dev_name = "smartcard";
@@ -782,12 +782,12 @@
reg = <0x0 0xfe000000 0x0 0x480000>;
irq_trigger_type = "GPIO_IRQ_LOW";
reset_pin-gpios = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_11 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_12 GPIO_ACTIVE_HIGH>;
reset_pin-gpios = <&gpio GPIOT_19 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOT_23 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_22 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_18 GPIO_ACTIVE_HIGH>;
interrupts = <0 174 1>;
interrupts = <0 81 1>;
interrupt-names = "smc0_irq";
/*
*Smc clock source, if change this,
@@ -804,8 +804,8 @@
pinctrl-names = "default";
pinctrl-0 = <&sd_iso7816_pins>;
// clocks = <&clkc CLKID_SC_CLK_GATE>;
// clock-names = "smartcard";
clocks = <&clkc CLKID_SYS_CLK_SMART_CARD>;
clock-names = "smartcard";
};
dvb-extern {
@@ -773,7 +773,7 @@
multi_core1 = <1>;
};
/* SMC */
/* SMC */
smartcard {
compatible = "amlogic,smartcard-sc2";
dev_name = "smartcard";
@@ -782,12 +782,12 @@
reg = <0x0 0xfe000000 0x0 0x480000>;
irq_trigger_type = "GPIO_IRQ_LOW";
reset_pin-gpios = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_11 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_12 GPIO_ACTIVE_HIGH>;
reset_pin-gpios = <&gpio GPIOT_19 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOT_23 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_22 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_18 GPIO_ACTIVE_HIGH>;
interrupts = <0 174 1>;
interrupts = <0 81 1>;
interrupt-names = "smc0_irq";
/*
*Smc clock source, if change this,
@@ -804,8 +804,8 @@
pinctrl-names = "default";
pinctrl-0 = <&sd_iso7816_pins>;
// clocks = <&clkc CLKID_SC_CLK_GATE>;
// clock-names = "smartcard";
clocks = <&clkc CLKID_SYS_CLK_SMART_CARD>;
clock-names = "smartcard";
};
dvb-extern {
@@ -775,7 +775,7 @@
multi_core1 = <1>;
};
/* SMC */
/* SMC */
smartcard {
compatible = "amlogic,smartcard-sc2";
dev_name = "smartcard";
@@ -784,12 +784,12 @@
reg = <0x0 0xfe000000 0x0 0x480000>;
irq_trigger_type = "GPIO_IRQ_LOW";
reset_pin-gpios = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_11 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_12 GPIO_ACTIVE_HIGH>;
reset_pin-gpios = <&gpio GPIOT_19 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOT_23 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_22 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_18 GPIO_ACTIVE_HIGH>;
interrupts = <0 174 1>;
interrupts = <0 81 1>;
interrupt-names = "smc0_irq";
/*
*Smc clock source, if change this,
@@ -806,8 +806,8 @@
pinctrl-names = "default";
pinctrl-0 = <&sd_iso7816_pins>;
// clocks = <&clkc CLKID_SC_CLK_GATE>;
// clock-names = "smartcard";
clocks = <&clkc CLKID_SYS_CLK_SMART_CARD>;
clock-names = "smartcard";
};
dvb-extern {
@@ -773,7 +773,7 @@
multi_core1 = <1>;
};
/* SMC */
/* SMC */
smartcard {
compatible = "amlogic,smartcard-sc2";
dev_name = "smartcard";
@@ -782,12 +782,12 @@
reg = <0x0 0xfe000000 0x0 0x480000>;
irq_trigger_type = "GPIO_IRQ_LOW";
reset_pin-gpios = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_11 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_12 GPIO_ACTIVE_HIGH>;
reset_pin-gpios = <&gpio GPIOT_19 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOT_23 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_22 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_18 GPIO_ACTIVE_HIGH>;
interrupts = <0 174 1>;
interrupts = <0 81 1>;
interrupt-names = "smc0_irq";
/*
*Smc clock source, if change this,
@@ -804,8 +804,8 @@
pinctrl-names = "default";
pinctrl-0 = <&sd_iso7816_pins>;
// clocks = <&clkc CLKID_SC_CLK_GATE>;
// clock-names = "smartcard";
clocks = <&clkc CLKID_SYS_CLK_SMART_CARD>;
clock-names = "smartcard";
};
dvb-extern {
@@ -773,7 +773,7 @@
multi_core1 = <1>;
};
/* SMC */
/* SMC */
smartcard {
compatible = "amlogic,smartcard-sc2";
dev_name = "smartcard";
@@ -782,12 +782,12 @@
reg = <0x0 0xfe000000 0x0 0x480000>;
irq_trigger_type = "GPIO_IRQ_LOW";
reset_pin-gpios = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_11 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_12 GPIO_ACTIVE_HIGH>;
reset_pin-gpios = <&gpio GPIOT_19 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOT_23 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_22 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_18 GPIO_ACTIVE_HIGH>;
interrupts = <0 174 1>;
interrupts = <0 81 1>;
interrupt-names = "smc0_irq";
/*
*Smc clock source, if change this,
@@ -804,8 +804,8 @@
pinctrl-names = "default";
pinctrl-0 = <&sd_iso7816_pins>;
// clocks = <&clkc CLKID_SC_CLK_GATE>;
// clock-names = "smartcard";
clocks = <&clkc CLKID_SYS_CLK_SMART_CARD>;
clock-names = "smartcard";
};
dvb-extern {
@@ -772,7 +772,7 @@
multi_core1 = <1>;
};
/* SMC */
/* SMC */
smartcard {
compatible = "amlogic,smartcard-sc2";
dev_name = "smartcard";
@@ -781,12 +781,12 @@
reg = <0x0 0xfe000000 0x0 0x480000>;
irq_trigger_type = "GPIO_IRQ_LOW";
reset_pin-gpios = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_11 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_12 GPIO_ACTIVE_HIGH>;
reset_pin-gpios = <&gpio GPIOT_19 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOT_23 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_22 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_18 GPIO_ACTIVE_HIGH>;
interrupts = <0 174 1>;
interrupts = <0 81 1>;
interrupt-names = "smc0_irq";
/*
*Smc clock source, if change this,
@@ -803,8 +803,8 @@
pinctrl-names = "default";
pinctrl-0 = <&sd_iso7816_pins>;
// clocks = <&clkc CLKID_SC_CLK_GATE>;
// clock-names = "smartcard";
clocks = <&clkc CLKID_SYS_CLK_SMART_CARD>;
clock-names = "smartcard";
};
dvb-extern {
@@ -772,7 +772,7 @@
multi_core1 = <1>;
};
/* SMC */
/* SMC */
smartcard {
compatible = "amlogic,smartcard-sc2";
dev_name = "smartcard";
@@ -781,12 +781,12 @@
reg = <0x0 0xfe000000 0x0 0x480000>;
irq_trigger_type = "GPIO_IRQ_LOW";
reset_pin-gpios = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_11 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_12 GPIO_ACTIVE_HIGH>;
reset_pin-gpios = <&gpio GPIOT_19 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOT_23 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_22 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_18 GPIO_ACTIVE_HIGH>;
interrupts = <0 174 1>;
interrupts = <0 81 1>;
interrupt-names = "smc0_irq";
/*
*Smc clock source, if change this,
@@ -803,8 +803,8 @@
pinctrl-names = "default";
pinctrl-0 = <&sd_iso7816_pins>;
// clocks = <&clkc CLKID_SC_CLK_GATE>;
// clock-names = "smartcard";
clocks = <&clkc CLKID_SYS_CLK_SMART_CARD>;
clock-names = "smartcard";
};
dvb-extern {
@@ -720,7 +720,7 @@
multi_core1 = <1>;
};
/* SMC */
/* SMC */
smartcard {
compatible = "amlogic,smartcard-sc2";
dev_name = "smartcard";
@@ -729,12 +729,12 @@
reg = <0x0 0xfe000000 0x0 0x480000>;
irq_trigger_type = "GPIO_IRQ_LOW";
reset_pin-gpios = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_11 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_12 GPIO_ACTIVE_HIGH>;
reset_pin-gpios = <&gpio GPIOT_19 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOT_23 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_22 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_18 GPIO_ACTIVE_HIGH>;
interrupts = <0 174 1>;
interrupts = <0 81 1>;
interrupt-names = "smc0_irq";
/*
*Smc clock source, if change this,
@@ -751,8 +751,8 @@
pinctrl-names = "default";
pinctrl-0 = <&sd_iso7816_pins>;
// clocks = <&clkc CLKID_SC_CLK_GATE>;
// clock-names = "smartcard";
clocks = <&clkc CLKID_SYS_CLK_SMART_CARD>;
clock-names = "smartcard";
};
dvb-extern {
@@ -720,7 +720,7 @@
multi_core1 = <1>;
};
/* SMC */
/* SMC */
smartcard {
compatible = "amlogic,smartcard-sc2";
dev_name = "smartcard";
@@ -729,12 +729,12 @@
reg = <0x0 0xfe000000 0x0 0x480000>;
irq_trigger_type = "GPIO_IRQ_LOW";
reset_pin-gpios = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_11 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_12 GPIO_ACTIVE_HIGH>;
reset_pin-gpios = <&gpio GPIOT_19 GPIO_ACTIVE_HIGH>;
detect_pin-gpios = <&gpio GPIOT_23 GPIO_ACTIVE_HIGH>;
enable_5v3v_pin-gpios = <&gpio GPIOT_22 GPIO_ACTIVE_HIGH>;
enable_pin-gpios = <&gpio GPIOT_18 GPIO_ACTIVE_HIGH>;
interrupts = <0 174 1>;
interrupts = <0 81 1>;
interrupt-names = "smc0_irq";
/*
*Smc clock source, if change this,
@@ -751,8 +751,8 @@
pinctrl-names = "default";
pinctrl-0 = <&sd_iso7816_pins>;
// clocks = <&clkc CLKID_SC_CLK_GATE>;
// clock-names = "smartcard";
clocks = <&clkc CLKID_SYS_CLK_SMART_CARD>;
clock-names = "smartcard";
};
dvb-extern {
+8 -4
View File
@@ -169,6 +169,7 @@ static int cpu_type;
#define REG_READ 0
#define REG_WRITE 1
static int sys_addr_offset = 0x38000;
#ifdef MEM_DEBUG
static void debug_write(const char __user *buf, size_t count)
@@ -499,7 +500,7 @@ static int sc2_read_smc(unsigned int reg)
static void sc2_write_sys(unsigned int reg, unsigned int val)
{
void *ptr = (void *)(p_smc_hw_base - 0x38000 + reg);
void *ptr = (void *)(p_smc_hw_base - sys_addr_offset + reg);
if (t5w_smartcard)
return;
@@ -511,7 +512,7 @@ static void sc2_write_sys(unsigned int reg, unsigned int val)
static int sc2_read_sys(unsigned int reg)
{
void *addr = p_smc_hw_base - 0x38000 + reg;
void *addr = p_smc_hw_base - sys_addr_offset + reg;
int ret = 0;
if (t5w_smartcard)
@@ -542,9 +543,12 @@ static int sc2_smc_addr(struct platform_device *pdev)
pr_error("%s addr:0x%x\n", __func__, (unsigned int)res->start);
if (res->start == 0xfe000000) {
p_smc_hw_base += 0x38000;
pr_error("sc2 smartcard\n");
cpu_type = get_cpu_type();
if (cpu_type == MESON_CPU_MAJOR_ID_S5)
sys_addr_offset = 0x40000;
p_smc_hw_base += sys_addr_offset;
pr_error("sc2 smartcard\n");
} else {
pr_error("t5w smartcard\n");
t5w_smartcard = 1;