mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
ODROID-COMMON: cpuinfo: set system revision by the board name in DT
Change-Id: I4ce4da547d246b3c82eb7dddb36a1d747f4d9cef Signed-off-by: Joshua Yang <joshua.yang@hardkernel.com> Signed-off-by: Dongjin Kim <tobetter@gmail.com>
This commit is contained in:
@@ -203,7 +203,6 @@ static int c_show(struct seq_file *m, void *v)
|
||||
seq_puts(m, "\n");
|
||||
#endif
|
||||
#endif
|
||||
system_rev = 0x0400;
|
||||
seq_printf(m, "Hardware\t: %s\n", machine_name);
|
||||
seq_printf(m, "Revision\t: %04x\n\n", system_rev);
|
||||
return 0;
|
||||
|
||||
@@ -64,14 +64,24 @@
|
||||
#include <asm/xen/hypervisor.h>
|
||||
#include <asm/mmu_context.h>
|
||||
|
||||
#include <linux/platform_data/board_odroid.h>
|
||||
|
||||
phys_addr_t __fdt_pointer __initdata;
|
||||
|
||||
const char *machine_name;
|
||||
#ifdef CONFIG_ARCH_MESON64_ODROID_COMMON
|
||||
const char *machine_name = "Hardkernel ODROID Ref.";
|
||||
EXPORT_SYMBOL(machine_name);
|
||||
|
||||
unsigned int system_rev;
|
||||
unsigned int system_rev = 0;
|
||||
EXPORT_SYMBOL(system_rev);
|
||||
|
||||
static u32 __odroid_model = 0;
|
||||
u32 odroid_model(void)
|
||||
{
|
||||
return __odroid_model;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Standard memory resources
|
||||
*/
|
||||
@@ -206,6 +216,16 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)
|
||||
|
||||
pr_info("Machine model: %s\n", name);
|
||||
dump_stack_set_arch_desc("%s (DT)", name);
|
||||
|
||||
#ifdef CONFIG_ARCH_MESON64_ODROID_COMMON
|
||||
if (!strcmp(machine_name, "Hardkernel ODROID-N2")) {
|
||||
system_rev = 0x0400;
|
||||
__odroid_model = BOARD_ODROIDN2;
|
||||
} else if (!strcmp(machine_name, "Hardkernel ODROID-C4")) {
|
||||
system_rev = 0x0500;
|
||||
__odroid_model = BOARD_ODROIDC4;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void __init request_standard_resources(void)
|
||||
|
||||
15
include/linux/platform_data/board_odroid.h
Normal file
15
include/linux/platform_data/board_odroid.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef __BOARD_ODROID_H
|
||||
#define __BOARD_ODROID_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define BOARD_ODROIDN2 0x09221000
|
||||
#define BOARD_ODROIDC4 0x09051000
|
||||
|
||||
extern bool odroid_amlogic_usb(void);
|
||||
extern u32 odroid_model(void);
|
||||
|
||||
#define board_is_odroidn2() (odroid_model() == BOARD_ODROIDN2)
|
||||
#define board_is_odroidc4() (odroid_model() == BOARD_ODROIDC4)
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user