From ac7a5d2a6626829d9ab8a5a7848dda269017b2f6 Mon Sep 17 00:00:00 2001 From: zhouxuezhi Date: Thu, 18 May 2017 14:50:08 +0800 Subject: [PATCH] Modification to adapt the interface spec(pmon and linux kernel interface spec): 1.add the member cpuname; 2.add the property DAM cache or uncache; 3.add the member DoSuspend (reset); 4.change the struct name efi to loongson_efi; Change-Id: I9d5b6b7628419b82d06b61cf66814a366a941096 --- pmon/cmds/bootparam.c | 6 ++++-- pmon/cmds/bootparam.h | 25 ++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/pmon/cmds/bootparam.c b/pmon/cmds/bootparam.c index 97ebea01..1f2a6937 100644 --- a/pmon/cmds/bootparam.c +++ b/pmon/cmds/bootparam.c @@ -31,7 +31,7 @@ struct efi_cpuinfo_loongson *init_cpu_info(); struct efi_memory_map_loongson * init_memory_map(); void init_loongson_params(struct loongson_params *lp); void init_smbios(struct smbios_tables *smbios); -void init_efi(struct efi *efi); +void init_efi(struct efi_loongson *efi); struct loongson_special_attribute *init_special_info(); void init_reset_system(struct efi_reset_system_t *reset); @@ -45,7 +45,7 @@ int init_boot_param(struct boot_params *bp) return bp; } -void init_efi(struct efi *efi) +void init_efi(struct efi_loongson *efi) { init_smbios(&(efi->smbios)); } @@ -86,6 +86,8 @@ void init_loongson_params(struct loongson_params *lp) lp->interface_offset = (unsigned long long)init_interface_info() - (unsigned long long)lp; lp->boarddev_table_offset = (unsigned long long)board_devices_info() - (unsigned long long)lp; lp->special_offset = (unsigned long long)init_special_info() - (unsigned long long)lp; + + printf("memory_offset = 0x%x;cpu_offset = 0x%x; system_offset = 0x%x; irq_offset = 0x%x; interface_offset = 0x%x;\n",lp->memory_offset,lp->cpu_offset,lp->system_offset,lp->irq_offset, lp->interface_offset); } diff --git a/pmon/cmds/bootparam.h b/pmon/cmds/bootparam.h index e6a120ed..39756bf8 100644 --- a/pmon/cmds/bootparam.h +++ b/pmon/cmds/bootparam.h @@ -50,6 +50,22 @@ struct efi_systab { enum loongson_cpu_type { Loongson_2F,Loongson_2E, Loongson_3A, Loongson_3B,Loongson_1A,Loongson_1B,Loongson_2G, +/* Legacy_2E = 0x0, + Legacy_2F = 0x1, + Legacy_3A = 0x2, + Legacy_3B = 0x3, + Legacy_1A = 0x4, + Legacy_1B = 0x5, + Legacy_2G = 0x6, + Legacy_2H = 0x7, + Loongson_1A = 0x100, + Loongson_1B = 0x101, + Loongson_2E = 0x200, + Loongson_2F = 0x201, + Loongson_2G = 0x202, + Loongson_2H = 0x203, + Loongson_3A = 0x300, + Loongson_3B = 0x301, */ }; struct efi_cpuinfo_loongson { @@ -65,6 +81,7 @@ struct efi_cpuinfo_loongson { unsigned short reserved_cores_mask; /* Core id: */ unsigned int cpu_clock_freq; //cpu_clock unsigned int nr_cpus; + unsigned char cpuname[64]; /*cpu name*/ }__attribute__((packed)); @@ -90,7 +107,8 @@ struct irq_source_routing_table { unsigned long long pci_io_start_addr; unsigned long long pci_io_end_addr; unsigned long long pci_config_addr; - unsigned int dma_mask_bits; + unsigned short dma_mask_bits; + unsigned short dma_noncoherent;/* 0:cache DMA ; 1:uncache DMA */ }__attribute__((packed)); @@ -150,9 +168,10 @@ struct efi_reset_system_t unsigned long long ResetWarm; unsigned long long ResetType; unsigned long long Shutdown; + unsigned long long DoSuspend; }; -struct efi { +struct efi_loongson { //efi_system_table_t systab; /* EFI system table */ unsigned long long mps; /* MPS table */ unsigned long long acpi; /* ACPI table (IA64 ext 0.71) */ @@ -177,7 +196,7 @@ struct efi { struct boot_params{ //struct screen_info *screen_info; //struct sys_desc_table *sys_desc_table; - struct efi efi; + struct efi_loongson efi; struct efi_reset_system_t reset_system; };