diff --git a/arch/arm64/configs/phytium_defconfig b/arch/arm64/configs/phytium_defconfig index 4589a28aedfe20db34d980cb0564e1da28ae3f58..bfd9785ca3963926b60c152796291394c1200ae6 100644 --- a/arch/arm64/configs/phytium_defconfig +++ b/arch/arm64/configs/phytium_defconfig @@ -249,7 +249,7 @@ CONFIG_MARVELL_PHY=m CONFIG_MARVELL_10G_PHY=m CONFIG_MICREL_PHY=y CONFIG_MOTORCOMM_PHY=y -CONFIG_REALTEK_PHY=m +CONFIG_REALTEK_PHY=y CONFIG_PPP=y CONFIG_PPP_DEFLATE=y CONFIG_PPP_ASYNC=y @@ -567,15 +567,14 @@ CONFIG_NFSD_SCSILAYOUT=y CONFIG_NFSD_FLEXFILELAYOUT=y CONFIG_NFSD_V4_SECURITY_LABEL=y CONFIG_NFSD_FAULT_INJECTION=y +CONFIG_CIFS=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y CONFIG_SECURITY=y CONFIG_CRYPTO_USER=y CONFIG_CRYPTO_AUTHENC=m -CONFIG_CRYPTO_CCM=y CONFIG_CRYPTO_GCM=y CONFIG_CRYPTO_ECHAINIV=y -CONFIG_CRYPTO_ARC4=y CONFIG_CRYPTO_ANSI_CPRNG=y CONFIG_CRYPTO_DRBG_HASH=y CONFIG_CRYPTO_USER_API_HASH=y diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h index 8e3b6da741549a6948d1525237d864656560862c..6ada8da330cf3d0fe51425359f76f9f1f08d8faa 100644 --- a/arch/arm64/include/asm/cputype.h +++ b/arch/arm64/include/asm/cputype.h @@ -107,10 +107,15 @@ #define NVIDIA_CPU_PART_DENVER 0x003 #define NVIDIA_CPU_PART_CARMEL 0x004 -#define PHYTIUM_CPU_PART_FTC662 0x662 - #define HISI_CPU_PART_TSV110 0xD01 +#define PHYTIUM_CPU_PART_FTC303 0x303 +#define PHYTIUM_CPU_PART_FTC660 0x660 +#define PHYTIUM_CPU_PART_FTC661 0x661 +#define PHYTIUM_CPU_PART_FTC662 0x662 +#define PHYTIUM_CPU_PART_FTC663 0x663 +#define PHYTIUM_CPU_PART_FTC664 0x664 + #define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53) #define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57) #define MIDR_CORTEX_A72 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A72) @@ -139,7 +144,12 @@ #define MIDR_NVIDIA_DENVER MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_DENVER) #define MIDR_NVIDIA_CARMEL MIDR_CPU_MODEL(ARM_CPU_IMP_NVIDIA, NVIDIA_CPU_PART_CARMEL) #define MIDR_HISI_TSV110 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_TSV110) +#define MIDR_PHYTIUM_FTC303 MIDR_CPU_MODEL(ARM_CPU_IMP_PHYTIUM, PHYTIUM_CPU_PART_FTC303) +#define MIDR_PHYTIUM_FTC660 MIDR_CPU_MODEL(ARM_CPU_IMP_PHYTIUM, PHYTIUM_CPU_PART_FTC660) +#define MIDR_PHYTIUM_FTC661 MIDR_CPU_MODEL(ARM_CPU_IMP_PHYTIUM, PHYTIUM_CPU_PART_FTC661) #define MIDR_PHYTIUM_PS17064 MIDR_CPU_MODEL(ARM_CPU_IMP_PHYTIUM, PHYTIUM_CPU_PART_FTC662) +#define MIDR_PHYTIUM_FTC663 MIDR_CPU_MODEL(ARM_CPU_IMP_PHYTIUM, PHYTIUM_CPU_PART_FTC663) +#define MIDR_PHYTIUM_FTC664 MIDR_CPU_MODEL(ARM_CPU_IMP_PHYTIUM, PHYTIUM_CPU_PART_FTC664) #ifndef __ASSEMBLY__ diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index d0b7dd60861bca4ac616944b99f331afea40a318..3f82c0ef0b351acde34c655a38912e0e567dfd47 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -481,6 +481,7 @@ static const struct midr_range arm64_ssb_cpus[] = { MIDR_ALL_VERSIONS(MIDR_CORTEX_A35), MIDR_ALL_VERSIONS(MIDR_CORTEX_A53), MIDR_ALL_VERSIONS(MIDR_CORTEX_A55), + MIDR_ALL_VERSIONS(MIDR_PHYTIUM_FTC303), {}, }; @@ -580,6 +581,7 @@ static const struct midr_range spectre_v2_safe_list[] = { MIDR_ALL_VERSIONS(MIDR_CORTEX_A35), MIDR_ALL_VERSIONS(MIDR_CORTEX_A53), MIDR_ALL_VERSIONS(MIDR_CORTEX_A55), + MIDR_ALL_VERSIONS(MIDR_PHYTIUM_FTC303), { /* sentinel */ } }; diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 787635e4ad76b00a8eb4fffdaf691a751aa62ba5..f64e1648f2305efae3705144053c2fad263e6e15 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -928,6 +928,12 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry, MIDR_ALL_VERSIONS(MIDR_CORTEX_A72), MIDR_ALL_VERSIONS(MIDR_CORTEX_A73), MIDR_ALL_VERSIONS(MIDR_HISI_TSV110), + MIDR_ALL_VERSIONS(MIDR_PHYTIUM_FTC303), + MIDR_ALL_VERSIONS(MIDR_PHYTIUM_FTC660), + MIDR_ALL_VERSIONS(MIDR_PHYTIUM_FTC661), + MIDR_ALL_VERSIONS(MIDR_PHYTIUM_PS17064), + MIDR_ALL_VERSIONS(MIDR_PHYTIUM_FTC663), + MIDR_ALL_VERSIONS(MIDR_PHYTIUM_FTC664), { /* sentinel */ } }; char const *str = "kpti command line option"; diff --git a/drivers/edac/phytium_edac.c b/drivers/edac/phytium_edac.c index df38935ac90300533700a973ac717e8a33da170f..060dc46b346c1c9e1405cda74379547fef136ae3 100644 --- a/drivers/edac/phytium_edac.c +++ b/drivers/edac/phytium_edac.c @@ -14,6 +14,8 @@ #include #include #include "edac_module.h" +#include +#include #define EDAC_MOD_STR "phytium_edac" @@ -36,21 +38,21 @@ #define CORRECTED_ERROR 0 #define UNCORRECTED_ERROR 1 -#define MAX_ERR_GROUP 3 +#define EDAC_DRIVER_VERSION "1.1.2" -#define EDAC_DRIVER_VERSION "1.1.1" +struct ras_error_info { + u32 index; + u32 error_type; + const char *error_str; +}; struct phytium_edac { struct device *dev; void __iomem **ras_base; struct dentry *dfs; struct edac_device_ctl_info *edac_dev; -}; - -struct ras_error_info { - u32 index; - u32 error_type; - const char *error_str; + int num_err_group; + const struct ras_error_info **error_info; }; /* error severity definition */ @@ -128,8 +130,182 @@ static const struct ras_error_info pe220x_ras_peu_error[] = { { 5, CORRECTED_ERROR, "axi_r_rsp_error" }, }; +/* pd2208 error */ +static const struct ras_error_info pd2208_ras_err[] = { + {0, CORRECTED_ERROR, "lmu0_ras_ecc_corrected_err"}, + {1, UNCORRECTED_ERROR, "lmu0_ras_ecc_uncorrected_err"}, + {2, CORRECTED_ERROR, "lmu1_ras_ecc_corrected_err"}, + {3, UNCORRECTED_ERROR, "lmu1_ras_ecc_uncorrected_err"}, + {4, CORRECTED_ERROR, "sram_corrected_err"}, + {5, UNCORRECTED_ERROR, "sram_uncorrected_err"}, + {6, UNCORRECTED_ERROR, "qspi_ras_addr_err"}, + {7, UNCORRECTED_ERROR, "qspi_ras_pstrb_err"}, + {8, UNCORRECTED_ERROR, "intreq_err"}, + {9, UNCORRECTED_ERROR, "gic_axim_err"}, + {10, UNCORRECTED_ERROR, "gic_ecc_fatal"}, + {11, UNCORRECTED_ERROR, "lsd_lbc_ras_err"}, + {12, UNCORRECTED_ERROR, "nEXTERRIRQ_cluster0"}, + {13, UNCORRECTED_ERROR, "nINTERRIRQ_cluster0"}, + {14, UNCORRECTED_ERROR, "nEXTERRIRQ_cluster1"}, + {15, UNCORRECTED_ERROR, "nINTERRIRQ_cluster1"}, + {16, UNCORRECTED_ERROR, "nEXTERRIRQ_cluster2"}, + {17, UNCORRECTED_ERROR, "nINTERRIRQ_cluster2"}, + {18, UNCORRECTED_ERROR, "nEXTERRIRQ_cluster3"}, + {19, UNCORRECTED_ERROR, "nINTERRIRQ_cluster3"}, + {20, CORRECTED_ERROR, "lbc_ecc_corrected_err"}, + {21, UNCORRECTED_ERROR, "lbc_ecc_uncorrected_err"}, +}; + +static const struct ras_error_info pd2208_ras_sram_err[] = { + {0, CORRECTED_ERROR, "scp_sram_corrected_err"}, + {1, UNCORRECTED_ERROR, "scp_sram_uncorrected_err"}, + {2, CORRECTED_ERROR, "scp_sharemem_corrected_err"}, + {3, UNCORRECTED_ERROR, "scp_sharemem_uncorrected_err"}, + {4, CORRECTED_ERROR, "wr_cmd_buf_corrected_err"}, + {5, UNCORRECTED_ERROR, "wr_cmd_buf_uncorrected_err"}, + {6, CORRECTED_ERROR, "rd_dat_buf_corrected_err"}, + {7, UNCORRECTED_ERROR, "rd_dat_buf_uncorrected_err"}, + {8, CORRECTED_ERROR, "wr_cmd_buf_corrected_err"}, + {9, UNCORRECTED_ERROR, "wr_cmd_buf_uncorrected_err"}, + {10, CORRECTED_ERROR, "wr_dat_buf_corrected_err"}, + {11, UNCORRECTED_ERROR, "wr_dat_buf_uncorrected_err"}, + {12, CORRECTED_ERROR, "drtrch0_corrected_err"}, + {13, UNCORRECTED_ERROR, "drtrch0_uncorrected_err"}, + {14, CORRECTED_ERROR, "drtrch0_corrected_err"}, + {15, UNCORRECTED_ERROR, "drtrch0_uncorrected_err"}, + {16, CORRECTED_ERROR, "dmac_corrected_err"}, + {17, UNCORRECTED_ERROR, "dmac_uncorrected_err"}, + {18, CORRECTED_ERROR, "rmram0_corrected_err"}, + {19, UNCORRECTED_ERROR, "rmram0_uncorrected_err"}, + {20, CORRECTED_ERROR, "rmram1_corrected_err"}, + {21, UNCORRECTED_ERROR, "rmram1_uncorrected_err"}, + {22, CORRECTED_ERROR, "rmram2_corrected_err"}, + {23, UNCORRECTED_ERROR, "rmram2_uncorrected_err"}, + {24, CORRECTED_ERROR, "rmram3_corrected_err"}, + {25, UNCORRECTED_ERROR, "rmram3_uncorrected_err"}, + {26, CORRECTED_ERROR, "gmactx0_corrected_err"}, + {27, UNCORRECTED_ERROR, "gmactx0_uncorrected_err"}, + {28, CORRECTED_ERROR, "gmactx1_corrected_err"}, + {29, UNCORRECTED_ERROR, "gmactx1_uncorrected_err"}, + {30, CORRECTED_ERROR, "gmactx2_corrected_err"}, + {31, UNCORRECTED_ERROR, "gmactx2_uncorrected_err"}, + {32, CORRECTED_ERROR, "gmactx3_corrected_err"}, + {33, UNCORRECTED_ERROR, "gmactx3_uncorrected_err"}, +}; + +static const struct ras_error_info pd2208_ras_peu_sram0_err[] = { + {0, CORRECTED_ERROR, "c0p2a_corrected_err"}, + {1, UNCORRECTED_ERROR, "c0p2a_uncorrected_err"}, + {2, CORRECTED_ERROR, "c0a2p_corrected_err"}, + {3, UNCORRECTED_ERROR, "c0a2p_uncorrected_err"}, + {4, CORRECTED_ERROR, "c0rxbuf0_corrected_err"}, + {5, UNCORRECTED_ERROR, "c0rxbuf0_uncorrected_err"}, + {6, CORRECTED_ERROR, "c0rxbuf1_corrected_err"}, + {7, UNCORRECTED_ERROR, "c0rxbuf1 _uncorrected_err"}, + {8, CORRECTED_ERROR, "c0rxbuf2_corrected_err"}, + {9, UNCORRECTED_ERROR, "c0rxbuf2 _uncorrected_err"}, + {10, CORRECTED_ERROR, "c0rxbuf3_corrected_err"}, + {11, UNCORRECTED_ERROR, "c0rxbuf3 _uncorrected_err"}, + {12, CORRECTED_ERROR, "c0txbuf0_corrected_err"}, + {13, UNCORRECTED_ERROR, "c0txbuf0_uncorrected_err"}, + {14, CORRECTED_ERROR, "c0txbuf1_corrected_err"}, + {15, UNCORRECTED_ERROR, "c0txbuf1 _uncorrected_err"}, + {16, CORRECTED_ERROR, "c0txbuf2_corrected_err"}, + {17, UNCORRECTED_ERROR, "c0txbuf2 _uncorrected_err"}, + {18, CORRECTED_ERROR, "c0txbuf3_corrected_err"}, + {19, UNCORRECTED_ERROR, "c0txbuf3 _uncorrected_err"}, + {20, CORRECTED_ERROR, "c1p2a_corrected_err"}, + {21, UNCORRECTED_ERROR, "c1p2a_uncorrected_err"}, + {22, CORRECTED_ERROR, "c1a2p_corrected_err"}, + {23, UNCORRECTED_ERROR, "c1a2p_uncorrected_err"}, + {24, CORRECTED_ERROR, "c1rxbuf0_corrected_err"}, + {25, UNCORRECTED_ERROR, "c1rxbuf0_uncorrected_err"}, + {26, CORRECTED_ERROR, "c1rxbuf1_corrected_err"}, + {27, UNCORRECTED_ERROR, "c1rxbuf1 _uncorrected_err"}, + {28, CORRECTED_ERROR, "c1rxbuf2_corrected_err"}, + {29, UNCORRECTED_ERROR, "c1rxbuf2 _uncorrected_err"}, + {30, CORRECTED_ERROR, "c1rxbuf3_corrected_err"}, + {31, UNCORRECTED_ERROR, "c1rxbuf3 _uncorrected_err"}, + {32, CORRECTED_ERROR, "c1txbuf0_corrected_err"}, + {33, UNCORRECTED_ERROR, "c1txbuf0_uncorrected_err"}, + {34, CORRECTED_ERROR, "c1txbuf1_corrected_err"}, + {35, UNCORRECTED_ERROR, "c1txbuf1 _uncorrected_err"}, + {36, CORRECTED_ERROR, "c1txbuf2_corrected_err"}, + {37, UNCORRECTED_ERROR, "c1txbuf2 _uncorrected_err"}, + {38, CORRECTED_ERROR, "c1txbuf3_corrected_err"}, + {39, UNCORRECTED_ERROR, "c1txbuf3 _uncorrected_err"}, + {40, CORRECTED_ERROR, "c2p2a_corrected_err"}, + {41, UNCORRECTED_ERROR, "c2p2a_uncorrected_err"}, + {42, CORRECTED_ERROR, "c2a2p_corrected_err"}, + {43, UNCORRECTED_ERROR, "c2a2p_uncorrected_err"}, + {44, CORRECTED_ERROR, "c2rxbuf0_corrected_err"}, + {45, UNCORRECTED_ERROR, "c2rxbuf0_uncorrected_err"}, + {46, CORRECTED_ERROR, "c2rxbuf1_corrected_err"}, + {47, UNCORRECTED_ERROR, "c2rxbuf1 _uncorrected_err"}, + {48, CORRECTED_ERROR, "c2rxbuf2_corrected_err"}, + {49, UNCORRECTED_ERROR, "c2rxbuf2 _uncorrected_err"}, + {50, CORRECTED_ERROR, "c2rxbuf3_corrected_err"}, + {51, UNCORRECTED_ERROR, "c2rxbuf3 _uncorrected_err"}, + {52, CORRECTED_ERROR, "c2txbuf0_corrected_err"}, + {53, UNCORRECTED_ERROR, "c2txbuf0_uncorrected_err"}, + {54, CORRECTED_ERROR, "c2txbuf1_corrected_err"}, + {55, UNCORRECTED_ERROR, "c2txbuf1 _uncorrected_err"}, +}; + +static const struct ras_error_info pd2208_ras_peu_sram1_err[] = { + {0, CORRECTED_ERROR, "c2txbuf2_corrected_err"}, + {1, UNCORRECTED_ERROR, "c2txbuf2_uncorrected_err"}, + {2, CORRECTED_ERROR, "c2txbuf3_corrected_err"}, + {3, UNCORRECTED_ERROR, "c2txbuf3_uncorrected_err"}, + {4, CORRECTED_ERROR, "phy0_sram0_corrected_err"}, + {5, UNCORRECTED_ERROR, "phy0_sram0_uncorrected_err"}, + {6, CORRECTED_ERROR, "phy0_sram1_corrected_err"}, + {7, UNCORRECTED_ERROR, "phy0_sram1 _uncorrected_err"}, + {8, CORRECTED_ERROR, "phy0_sram2_corrected_err"}, + {9, UNCORRECTED_ERROR, "phy0_sram2 _uncorrected_err"}, + {10, CORRECTED_ERROR, "phy0_sram3_corrected_err"}, + {11, UNCORRECTED_ERROR, "phy0_sram3 _uncorrected_err"}, + {12, CORRECTED_ERROR, "phy1_sram0_corrected_err"}, + {13, UNCORRECTED_ERROR, "phy1_sram0_uncorrected_err"}, + {14, CORRECTED_ERROR, "mac0_rxdpram_corrected_err"}, + {15, UNCORRECTED_ERROR, "mac0_rxdpram _uncorrected_err"}, + {16, CORRECTED_ERROR, "mac0_txdpram_corrected_err"}, + {17, UNCORRECTED_ERROR, "mac0_txdpram _uncorrected_err"}, + {18, CORRECTED_ERROR, "mac1_rxdpram_corrected_err"}, + {19, UNCORRECTED_ERROR, "mac1_rxdpram _uncorrected_err"}, + {20, CORRECTED_ERROR, "mac1_txdpram_corrected_err"}, + {21, UNCORRECTED_ERROR, "mac1_txdpram _uncorrected_err"}, +}; + +static const struct ras_error_info pd2208_ras_peu_base_err[] = { + {0, UNCORRECTED_ERROR, "pio_rd_addr_error"}, + {1, UNCORRECTED_ERROR, "pio_rd_timeout"}, + {2, UNCORRECTED_ERROR, "pio_wr_addr_error"}, + {3, UNCORRECTED_ERROR, "pio_wr_timeout"}, + {4, CORRECTED_ERROR, "axi_b_rsp_error"}, + {5, UNCORRECTED_ERROR, "axi_r_rsp_error"}, + {6, UNCORRECTED_ERROR, "mac0_asf_trans_to_err"}, + {7, UNCORRECTED_ERROR, "mac0_asf_protocol_err"}, + {8, UNCORRECTED_ERROR, "mac0_asf_nonfatal_int"}, + {9, UNCORRECTED_ERROR, "mac0_asf_fatal_int"}, + {10, UNCORRECTED_ERROR, "mac1_asf_trans_to_err"}, + {11, UNCORRECTED_ERROR, "mac1_asf_protocol_err"}, + {12, UNCORRECTED_ERROR, "mac1_asf_nonfatal_int"}, + {13, UNCORRECTED_ERROR, "mac1_asf_fatal_int"}, +}; + static const struct ras_error_info *pe220x_ras_error[] = { - pe220x_ras_soc_error, pe220x_ras_peu_psu_error, pe220x_ras_peu_error + pe220x_ras_soc_error, + pe220x_ras_peu_psu_error, + pe220x_ras_peu_error, +}; + +static const struct ras_error_info *pd2208_ras_error[] = { + pd2208_ras_err, + pd2208_ras_sram_err, + pd2208_ras_peu_sram0_err, + pd2208_ras_peu_sram1_err, + pd2208_ras_peu_base_err, }; static inline unsigned int get_error_num(const struct phytium_edac *edac, @@ -146,11 +322,11 @@ static inline void phytium_ras_setup(const struct phytium_edac *edac) { u64 val = 0; unsigned int i = 0; + /* * enable error report and generate interrupt for corrected error event - * first error record owned by node present the node configuration */ - for (i = 0; i < MAX_ERR_GROUP; i++) { + for (i = 0; i < edac->num_err_group; i++) { val = readq(edac->ras_base[i] + ERR_CTLR(0)); val |= CTLR_ED | CTLR_UI | CTLR_CFI; writeq(val, edac->ras_base[i] + ERR_CTLR(0)); @@ -190,7 +366,7 @@ static ssize_t phytium_edac_inject_ctrl_write(struct file *filp, goto out; res = kstrtouint(tmp, 0, &error_group); - if (res || error_group >= MAX_ERR_GROUP) { + if (res || error_group >= edac->num_err_group) { dev_err(edac->dev, "invalid error group parameters"); goto out; } @@ -207,11 +383,11 @@ static ssize_t phytium_edac_inject_ctrl_write(struct file *filp, goto out; } - dev_dbg(edac->dev, "inject group%d, error_id: %d\n", + dev_dbg(edac->dev, "inject group: %d, error_id: %d\n", error_group, error_id); - if (pe220x_ras_error[error_group][error_id].error_type == - CORRECTED_ERROR) { + if (edac->error_info[error_group][error_id].error_type + == CORRECTED_ERROR) { writeq(MISC0_CEC(0xFF), edac->ras_base[error_group] + ERR_MISC0(error_id)); } @@ -295,7 +471,7 @@ static int get_error_id(struct phytium_edac *edac, int *error_id, int err_id = 0; /* Iterate over the ras node to check error status */ - for (i = 0; i < MAX_ERR_GROUP; i++) { + for (i = 0; i < edac->num_err_group; i++) { error_num = get_error_num(edac, i); error_bit = readq(edac->ras_base[i] + ERR_GSR); for (err_id = 0; err_id < error_num; err_id++) { @@ -311,7 +487,7 @@ static int get_error_id(struct phytium_edac *edac, int *error_id, } } - if (i >= MAX_ERR_GROUP) { + if (i >= edac->num_err_group) { ret = -1; dev_warn(edac->dev, "no error detect.\n"); } @@ -324,7 +500,12 @@ static void phytium_edac_error_report(struct phytium_edac *edac, const int error_group) { const struct ras_error_info *err_info = - pe220x_ras_error[error_group]; + edac->error_info[error_group]; + + /* ignore pe220x soc_err id 40~43 */ + if ((err_info == pe220x_ras_soc_error) && + (error_id >= 40) && (error_id <= 43)) + return; if (err_info[error_id].error_type == UNCORRECTED_ERROR) { edac_printk(KERN_CRIT, EDAC_MOD_STR, "uncorrected error: %s\n", @@ -382,6 +563,17 @@ static irqreturn_t phytium_edac_isr(int irq, void *dev_id) return IRQ_HANDLED; } +static inline int of_address_count(struct device_node *np) +{ + struct resource res; + int count = 0; + + while (of_address_to_resource(np, count, &res) == 0) + count++; + + return count; +} + static int phytium_edac_probe(struct platform_device *pdev) { struct phytium_edac *edac; @@ -400,14 +592,23 @@ static int phytium_edac_probe(struct platform_device *pdev) edac->dev = &pdev->dev; platform_set_drvdata(pdev, edac); - edac->ras_base = devm_kcalloc(&pdev->dev, 3, - sizeof(*edac->ras_base), GFP_KERNEL); + edac->error_info = + (const struct ras_error_info **)of_device_get_match_data(&pdev->dev); + + edac->num_err_group = of_address_count(pdev->dev.of_node); + if (edac->num_err_group <= 0) { + dev_err(&pdev->dev, "can't get error group count"); + goto out; + } + + edac->ras_base = devm_kcalloc(&pdev->dev, edac->num_err_group, + sizeof(*edac->ras_base), GFP_KERNEL); if (!edac->ras_base) { return -ENOMEM; goto out; } - for (i = 0; i < MAX_ERR_GROUP; i++) { + for (i = 0; i < edac->num_err_group; i++) { res = platform_get_resource(pdev, IORESOURCE_MEM, i); edac->ras_base[i] = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(edac->ras_base[i])) { @@ -465,7 +666,10 @@ static int phytium_edac_remove(struct platform_device *pdev) } static const struct of_device_id phytium_edac_of_match[] = { - { .compatible = "phytium,pe220x-edac" }, + { .compatible = "phytium,pe220x-edac", + .data = pe220x_ras_error }, + { .compatible = "phytium,pd2208-edac", + .data = pd2208_ras_error }, {}, }; MODULE_DEVICE_TABLE(of, phytium_edac_of_match); diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index bcaab7f5525c055ca613c3f194fd4e25da6326aa..1d9318da02f41e0b5dd32c8ee3974271018c2b4b 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -78,7 +78,7 @@ #define GEM_MAX_TX_LEN (unsigned int)(0x3FC0) #define GEM_MTU_MIN_SIZE ETH_MIN_MTU -#define MACB_NETIF_LSO NETIF_F_TSO +#define MACB_NETIF_LSO (NETIF_F_TSO | NETIF_F_TSO6) #define HS_SPEED_100M 0 #define HS_SPEED_1000M 1 diff --git a/drivers/net/ethernet/phytium/phytmac_ethtool.c b/drivers/net/ethernet/phytium/phytmac_ethtool.c index b3f61d4808091f42e42f81215c47ab3a4dd5728b..bd37392a87ebfa29513082c81f9cc0e30a0f06cb 100644 --- a/drivers/net/ethernet/phytium/phytmac_ethtool.c +++ b/drivers/net/ethernet/phytium/phytmac_ethtool.c @@ -381,8 +381,13 @@ static int phytmac_get_link_ksettings(struct net_device *ndev, if (!ndev->phydev) { kset->base.port = PORT_FIBRE; kset->base.transceiver = XCVR_INTERNAL; - kset->base.duplex = pdata->duplex; - kset->base.speed = pdata->speed; + if (netif_carrier_ok(ndev)) { + kset->base.duplex = pdata->duplex; + kset->base.speed = pdata->speed; + } else { + kset->base.duplex = DUPLEX_UNKNOWN; + kset->base.speed = SPEED_UNKNOWN; + } if (pdata->phy_interface == PHY_INTERFACE_MODE_USXGMII) { supported = SUPPORTED_10000baseT_Full diff --git a/drivers/net/ethernet/phytium/phytmac_main.c b/drivers/net/ethernet/phytium/phytmac_main.c index 49f7ba581681b5d104bb2361c43b1b22b0aee012..b8c715dbaa72993c0d4e406540b04ecc47a57e5b 100644 --- a/drivers/net/ethernet/phytium/phytmac_main.c +++ b/drivers/net/ethernet/phytium/phytmac_main.c @@ -2302,7 +2302,7 @@ static netdev_features_t phytmac_features_check(struct sk_buff *skb, hdrlen = skb_transport_offset(skb); if (!IS_ALIGNED(skb_headlen(skb) - hdrlen, PHYTMAC_TX_LEN_ALIGN)) - return features & ~NETIF_F_TSO; + return features & ~(NETIF_F_TSO | NETIF_F_TSO6); nr_frags = skb_shinfo(skb)->nr_frags; /* No need to check last fragment */ @@ -2311,7 +2311,7 @@ static netdev_features_t phytmac_features_check(struct sk_buff *skb, const skb_frag_t *frag = &skb_shinfo(skb)->frags[f]; if (!IS_ALIGNED(skb_frag_size(frag), PHYTMAC_TX_LEN_ALIGN)) - return features & ~NETIF_F_TSO; + return features & ~(NETIF_F_TSO | NETIF_F_TSO6); } return features; } @@ -2603,7 +2603,7 @@ void phytmac_default_config(struct phytmac *pdata) ndev->hw_features = NETIF_F_SG; if (pdata->capacities & PHYTMAC_CAPS_LSO) - ndev->hw_features |= NETIF_F_TSO; + ndev->hw_features |= NETIF_F_TSO | NETIF_F_TSO6; if (pdata->use_ncsi) { ndev->hw_features &= ~(NETIF_F_HW_CSUM | NETIF_F_RXCSUM); diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c index 79ea717672e8b54265c276e78a552c59940468a3..6bd0460398731123c62ed328437aba1fbcb2eb92 100755 --- a/drivers/net/phy/motorcomm.c +++ b/drivers/net/phy/motorcomm.c @@ -1559,6 +1559,8 @@ static int yt8521_read_status(struct phy_device *phydev) ytxxxx_adjust_status(phydev, val_utp, 1); } else { link_utp = 0; + phydev->speed = SPEED_UNKNOWN; + phydev->duplex = DUPLEX_UNKNOWN; } if (link_utp) {