update /proc/cpuinfo

This commit is contained in:
August 2024-06-20 18:04:07 +08:00
parent 50d5536d03
commit 7581bba58e
7 changed files with 48 additions and 4 deletions

View File

@ -4,7 +4,7 @@
interrupt-parent = <0x1>; interrupt-parent = <0x1>;
#address-cells = <0x2>; #address-cells = <0x2>;
#size-cells = <0x2>; #size-cells = <0x2>;
model = "Bananapi M4Berry"; model = "Bananapi BPI-M4Berry";
compatible = "allwinner,h616", "arm,sun50iw9p1"; compatible = "allwinner,h616", "arm,sun50iw9p1";
aliases { aliases {

View File

@ -4,7 +4,7 @@
interrupt-parent = <0x1>; interrupt-parent = <0x1>;
#address-cells = <0x2>; #address-cells = <0x2>;
#size-cells = <0x2>; #size-cells = <0x2>;
model = "Bananapi M4Zero"; model = "Bananapi BPI-M4Zero";
compatible = "allwinner,h616", "arm,sun50iw9p1"; compatible = "allwinner,h616", "arm,sun50iw9p1";
aliases { aliases {

View File

@ -24,6 +24,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/sunxi-sid.h>
/* /*
* In case the boot CPU is hotpluggable, we record its initial state and * In case the boot CPU is hotpluggable, we record its initial state and
@ -128,6 +129,10 @@ static int c_show(struct seq_file *m, void *v)
{ {
int i, j; int i, j;
bool compat = personality(current->personality) == PER_LINUX32; bool compat = personality(current->personality) == PER_LINUX32;
#if defined(CONFIG_BOARD_BANANAPI_M4BERRY) || defined(CONFIG_BOARD_BANANAPI_M4ZERO)
int databuf[4] = {0};
char tmpbuf[129] = {0};
#endif
for_each_online_cpu(i) { for_each_online_cpu(i) {
struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i); struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i);
@ -179,6 +184,22 @@ static int c_show(struct seq_file *m, void *v)
seq_printf(m, "CPU revision\t: %d\n\n", MIDR_REVISION(midr)); seq_printf(m, "CPU revision\t: %d\n\n", MIDR_REVISION(midr));
} }
#if defined(CONFIG_BOARD_BANANAPI_M4BERRY) || defined(CONFIG_BOARD_BANANAPI_M4ZERO)
/* platform */
sunxi_get_platform(tmpbuf, 129);
seq_printf(m, "CPU Platform\t: %s\n", tmpbuf);
/* chipid */
sunxi_get_soc_chipid((u8 *)databuf);
for (i = 0; i < 4; i++)
sprintf(tmpbuf + i*8, "%08x", databuf[i]);
tmpbuf[128] = 0;
seq_printf(m, "Serial\t\t: %s\n", tmpbuf);
seq_printf(m, "Hardware\t: %s\n", machine_name);
seq_printf(m, "Revision\t: %04x\n\n", system_rev);
#endif
return 0; return 0;
} }

View File

@ -56,6 +56,14 @@ static struct resource *standard_resources;
phys_addr_t __fdt_pointer __initdata; phys_addr_t __fdt_pointer __initdata;
#if defined(CONFIG_BOARD_BANANAPI_M4BERRY) || defined(CONFIG_BOARD_BANANAPI_M4ZERO)
const char *machine_name = "Bananapi BPI Ref.";
EXPORT_SYMBOL(machine_name);
unsigned int system_rev = 0;
EXPORT_SYMBOL(system_rev);
#endif
/* /*
* Standard memory resources * Standard memory resources
*/ */
@ -197,6 +205,16 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)
pr_info("Machine model: %s\n", name); pr_info("Machine model: %s\n", name);
dump_stack_set_arch_desc("%s (DT)", name); dump_stack_set_arch_desc("%s (DT)", name);
/* bpi */
#if defined(CONFIG_BOARD_BANANAPI_M4BERRY) || defined(CONFIG_BOARD_BANANAPI_M4ZERO)
machine_name = name;
if (!strcmp(machine_name, "Bananapi BPI-M4Berry")) {
system_rev = 0x0002;
} else if (!strcmp(machine_name, "Bananapi BPI-M4Zero")) {
system_rev = 0x0003;
}
#endif
} }
static void __init request_standard_resources(void) static void __init request_standard_resources(void)

View File

@ -1221,7 +1221,7 @@ out:
static void geth_check_addr(struct net_device *ndev, unsigned char *mac) static void geth_check_addr(struct net_device *ndev, unsigned char *mac)
{ {
int i, j; int i;
char *p = mac; char *p = mac;
struct geth_priv *priv = netdev_priv(ndev); struct geth_priv *priv = netdev_priv(ndev);

View File

@ -84,7 +84,7 @@ static int link_mode_8614[4] = {0}; //0: no link; 1: utp; 32: fiber. traced that
static unsigned int yt_mport_base_phy_addr = 0xff; //0xff: invalid; for 8618 static unsigned int yt_mport_base_phy_addr = 0xff; //0xff: invalid; for 8618
static unsigned int yt_mport_base_phy_addr_8614 = 0xff; //0xff: invalid; static unsigned int yt_mport_base_phy_addr_8614 = 0xff; //0xff: invalid;
static int yt8511_config_out_125m(struct mii_bus *bus, int phy_id); int yt8511_config_out_125m(struct mii_bus *bus, int phy_id);
static int ytphy_mii_wr_ext(struct mii_bus *bus, int phy_id, u32 regnum, u16 val); static int ytphy_mii_wr_ext(struct mii_bus *bus, int phy_id, u32 regnum, u16 val);
static int phy_yt8531_led_fixup(struct mii_bus *bus, int addr) static int phy_yt8531_led_fixup(struct mii_bus *bus, int addr)

View File

@ -91,4 +91,9 @@ int sunxi_soc_is_secure(void);
s32 sunxi_get_platform(s8 *buf, s32 size); s32 sunxi_get_platform(s8 *buf, s32 size);
s32 sunxi_efuse_readn(s8 *key_name, void *buf, u32 n); s32 sunxi_efuse_readn(s8 *key_name, void *buf, u32 n);
#if defined(CONFIG_BOARD_BANANAPI_M4BERRY) || defined(CONFIG_BOARD_BANANAPI_M4ZERO)
extern const char *machine_name;
extern unsigned int system_rev;
#endif
#endif /* __SUNXI_MACH_SUNXI_CHIP_H */ #endif /* __SUNXI_MACH_SUNXI_CHIP_H */