Skip to content

Commit f6f5bf4

Browse files
smbios support
1 parent 582f851 commit f6f5bf4

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

arch/arm/mach-apple/board.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ void build_mem_map(void)
709709
int i;
710710

711711
if (of_machine_is_compatible("apple,t8103") ||
712-
of_machine_is_compatible("apple,t8112"))
712+
of_machine_is_compatible("apple,t8112"))
713713
mem_map = t8103_mem_map;
714714
else if (of_machine_is_compatible("apple,t6000") ||
715715
of_machine_is_compatible("apple,t6001"))
@@ -845,6 +845,8 @@ char *env_fat_get_dev_part(void)
845845
int board_late_init(void)
846846
{
847847
struct lmb lmb;
848+
int root_node_offset;
849+
const char* serial_number;
848850
u32 status = 0;
849851

850852
status |= env_set("storage_interface",
@@ -861,10 +863,25 @@ int board_late_init(void)
861863
status |= env_set_hex("kernel_addr_r", lmb_alloc(&lmb, SZ_128M, SZ_2M));
862864
status |= env_set_hex("ramdisk_addr_r", lmb_alloc(&lmb, SZ_1G, SZ_2M));
863865
status |= env_set_hex("kernel_comp_addr_r",
864-
lmb_alloc(&lmb, KERNEL_COMP_SIZE, SZ_2M));
866+
lmb_alloc(&lmb, KERNEL_COMP_SIZE, SZ_2M));
865867
status |= env_set_hex("kernel_comp_size", KERNEL_COMP_SIZE);
866868
status |= env_set_hex("scriptaddr", lmb_alloc(&lmb, SZ_4M, SZ_2M));
867869
status |= env_set_hex("pxefile_addr_r", lmb_alloc(&lmb, SZ_4M, SZ_2M));
870+
871+
root_node_offset = fdt_path_offset((const void*) fw_dtb_pointer, "/");
872+
if (root_node_offset < 0) {
873+
log_warning("late_init: fdt_path_offset() for root_node_offset returned %s\n", fdt_strerror(root_node_offset));
874+
status = 1;
875+
} else {
876+
serial_number = fdt_getprop((const void*) fw_dtb_pointer, root_node_offset, "serial-number", NULL);
877+
if(serial_number) {
878+
status |= env_set("serial#", serial_number);
879+
log_info("late_init: serial number is %s\n", serial_number);
880+
} else {
881+
log_warning("late_init: Failed to get serial number from device tree\n");
882+
status = 1;
883+
}
884+
}
868885

869886
if (status)
870887
log_warning("late_init: Failed to set run time variables\n");

configs/apple_m1_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ CONFIG_USB_KEYBOARD=y
2323
CONFIG_SYS_WHITE_ON_BLACK=y
2424
CONFIG_NO_FB_CLEAR=y
2525
CONFIG_VIDEO_SIMPLE=y
26-
# CONFIG_SMBIOS is not set
2726
CONFIG_LMB_MAX_REGIONS=64

0 commit comments

Comments
 (0)