Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added SMBIOS support #24

Open
wants to merge 1 commit into
base: asahi
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions arch/arm/mach-apple/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ void build_mem_map(void)
int i;

if (of_machine_is_compatible("apple,t8103") ||
of_machine_is_compatible("apple,t8112"))
of_machine_is_compatible("apple,t8112"))
mem_map = t8103_mem_map;
else if (of_machine_is_compatible("apple,t6000") ||
of_machine_is_compatible("apple,t6001"))
Expand Down Expand Up @@ -845,6 +845,8 @@ char *env_fat_get_dev_part(void)
int board_late_init(void)
{
struct lmb lmb;
int root_node_offset;
const char* serial_number;
u32 status = 0;

status |= env_set("storage_interface",
Expand All @@ -861,10 +863,25 @@ int board_late_init(void)
status |= env_set_hex("kernel_addr_r", lmb_alloc(&lmb, SZ_128M, SZ_2M));
status |= env_set_hex("ramdisk_addr_r", lmb_alloc(&lmb, SZ_1G, SZ_2M));
status |= env_set_hex("kernel_comp_addr_r",
lmb_alloc(&lmb, KERNEL_COMP_SIZE, SZ_2M));
lmb_alloc(&lmb, KERNEL_COMP_SIZE, SZ_2M));
status |= env_set_hex("kernel_comp_size", KERNEL_COMP_SIZE);
status |= env_set_hex("scriptaddr", lmb_alloc(&lmb, SZ_4M, SZ_2M));
status |= env_set_hex("pxefile_addr_r", lmb_alloc(&lmb, SZ_4M, SZ_2M));

root_node_offset = fdt_path_offset((const void*) fw_dtb_pointer, "/");
if (root_node_offset < 0) {
log_warning("late_init: fdt_path_offset() for root_node_offset returned %s\n", fdt_strerror(root_node_offset));
status = 1;
} else {
serial_number = fdt_getprop((const void*) fw_dtb_pointer, root_node_offset, "serial-number", NULL);
if(serial_number) {
status |= env_set("serial#", serial_number);
log_info("late_init: serial number is %s\n", serial_number);
} else {
log_warning("late_init: Failed to get serial number from device tree\n");
status = 1;
}
}

if (status)
log_warning("late_init: Failed to set run time variables\n");
Expand Down
1 change: 0 additions & 1 deletion configs/apple_m1_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ CONFIG_USB_KEYBOARD=y
CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_NO_FB_CLEAR=y
CONFIG_VIDEO_SIMPLE=y
# CONFIG_SMBIOS is not set
CONFIG_LMB_MAX_REGIONS=64