Commit 905fdcb5264c7b0ed2896dc042e6fe3dd0e25952

Authored by blueswir1
1 parent 084a197a

Add common keys to firmware configuration

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5260 c046a42c-6fe2-441c-8c8c-71466251a162
hw/fw_cfg.c
@@ -259,6 +259,7 @@ void *fw_cfg_init(uint32_t ctl_port, uint32_t data_port, @@ -259,6 +259,7 @@ void *fw_cfg_init(uint32_t ctl_port, uint32_t data_port,
259 { 259 {
260 FWCfgState *s; 260 FWCfgState *s;
261 int io_ctl_memory, io_data_memory; 261 int io_ctl_memory, io_data_memory;
  262 + extern int nographic;
262 263
263 s = qemu_mallocz(sizeof(FWCfgState)); 264 s = qemu_mallocz(sizeof(FWCfgState));
264 if (!s) 265 if (!s)
@@ -283,6 +284,9 @@ void *fw_cfg_init(uint32_t ctl_port, uint32_t data_port, @@ -283,6 +284,9 @@ void *fw_cfg_init(uint32_t ctl_port, uint32_t data_port,
283 } 284 }
284 fw_cfg_add_bytes(s, FW_CFG_SIGNATURE, (uint8_t *)"QEMU", 4); 285 fw_cfg_add_bytes(s, FW_CFG_SIGNATURE, (uint8_t *)"QEMU", 4);
285 fw_cfg_add_bytes(s, FW_CFG_UUID, qemu_uuid, 16); 286 fw_cfg_add_bytes(s, FW_CFG_UUID, qemu_uuid, 16);
  287 + fw_cfg_add_i16(s, FW_CFG_NOGRAPHIC, (uint16_t)nographic);
  288 + fw_cfg_add_i16(s, FW_CFG_NB_CPUS, (uint16_t)smp_cpus);
  289 +
286 register_savevm("fw_cfg", -1, 1, fw_cfg_save, fw_cfg_load, s); 290 register_savevm("fw_cfg", -1, 1, fw_cfg_save, fw_cfg_load, s);
287 qemu_register_reset(fw_cfg_reset, s); 291 qemu_register_reset(fw_cfg_reset, s);
288 fw_cfg_reset(s); 292 fw_cfg_reset(s);
hw/fw_cfg.h
@@ -4,6 +4,10 @@ @@ -4,6 +4,10 @@
4 #define FW_CFG_SIGNATURE 0x00 4 #define FW_CFG_SIGNATURE 0x00
5 #define FW_CFG_ID 0x01 5 #define FW_CFG_ID 0x01
6 #define FW_CFG_UUID 0x02 6 #define FW_CFG_UUID 0x02
  7 +#define FW_CFG_RAM_SIZE 0x03
  8 +#define FW_CFG_NOGRAPHIC 0x04
  9 +#define FW_CFG_NB_CPUS 0x05
  10 +#define FW_CFG_MACHINE_ID 0x06
7 #define FW_CFG_MAX_ENTRY 0x10 11 #define FW_CFG_MAX_ENTRY 0x10
8 12
9 #define FW_CFG_WRITE_CHANNEL 0x4000 13 #define FW_CFG_WRITE_CHANNEL 0x4000
@@ -433,6 +433,7 @@ static void bochs_bios_init(void) @@ -433,6 +433,7 @@ static void bochs_bios_init(void)
433 433
434 fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0); 434 fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);
435 fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1); 435 fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
  436 + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
436 } 437 }
437 438
438 /* Generate an initial boot sector which sets state and jump to 439 /* Generate an initial boot sector which sets state and jump to
hw/sun4m.c
@@ -101,7 +101,8 @@ struct hwdef { @@ -101,7 +101,8 @@ struct hwdef {
101 // register bit numbers 101 // register bit numbers
102 int intctl_g_intr, esp_irq, le_irq, clock_irq, clock1_irq; 102 int intctl_g_intr, esp_irq, le_irq, clock_irq, clock1_irq;
103 int ser_irq, ms_kb_irq, fd_irq, me_irq, cs_irq, ecc_irq; 103 int ser_irq, ms_kb_irq, fd_irq, me_irq, cs_irq, ecc_irq;
104 - int machine_id; // For NVRAM 104 + uint8_t nvram_machine_id;
  105 + uint16_t machine_id;
105 uint32_t iommu_version; 106 uint32_t iommu_version;
106 uint32_t intbit_to_level[32]; 107 uint32_t intbit_to_level[32];
107 uint64_t max_mem; 108 uint64_t max_mem;
@@ -122,7 +123,8 @@ struct sun4d_hwdef { @@ -122,7 +123,8 @@ struct sun4d_hwdef {
122 // IRQ numbers are not PIL ones, but SBI register bit numbers 123 // IRQ numbers are not PIL ones, but SBI register bit numbers
123 int esp_irq, le_irq, clock_irq, clock1_irq; 124 int esp_irq, le_irq, clock_irq, clock1_irq;
124 int ser_irq, ms_kb_irq, me_irq; 125 int ser_irq, ms_kb_irq, me_irq;
125 - int machine_id; // For NVRAM 126 + uint8_t nvram_machine_id;
  127 + uint16_t machine_id;
126 uint32_t iounit_version; 128 uint32_t iounit_version;
127 uint64_t max_mem; 129 uint64_t max_mem;
128 const char * const default_cpu_model; 130 const char * const default_cpu_model;
@@ -178,7 +180,7 @@ static void nvram_init(m48t59_t *nvram, uint8_t *macaddr, const char *cmdline, @@ -178,7 +180,7 @@ static void nvram_init(m48t59_t *nvram, uint8_t *macaddr, const char *cmdline,
178 const char *boot_devices, ram_addr_t RAM_size, 180 const char *boot_devices, ram_addr_t RAM_size,
179 uint32_t kernel_size, 181 uint32_t kernel_size,
180 int width, int height, int depth, 182 int width, int height, int depth,
181 - int machine_id, const char *arch) 183 + int nvram_machine_id, const char *arch)
182 { 184 {
183 unsigned int i; 185 unsigned int i;
184 uint32_t start, end; 186 uint32_t start, end;
@@ -251,7 +253,8 @@ static void nvram_init(m48t59_t *nvram, uint8_t *macaddr, const char *cmdline, @@ -251,7 +253,8 @@ static void nvram_init(m48t59_t *nvram, uint8_t *macaddr, const char *cmdline,
251 end = 0x1fd0; 253 end = 0x1fd0;
252 OpenBIOS_finish_partition(part_header, end - start); 254 OpenBIOS_finish_partition(part_header, end - start);
253 255
254 - Sun_init_header((struct Sun_nvram *)&image[0x1fd8], macaddr, machine_id); 256 + Sun_init_header((struct Sun_nvram *)&image[0x1fd8], macaddr,
  257 + nvram_machine_id);
255 258
256 for (i = 0; i < sizeof(image); i++) 259 for (i = 0; i < sizeof(image); i++)
257 m48t59_write(nvram, i, image[i]); 260 m48t59_write(nvram, i, image[i]);
@@ -568,7 +571,8 @@ static void sun4m_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size, @@ -568,7 +571,8 @@ static void sun4m_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size,
568 571
569 nvram_init(nvram, (uint8_t *)&nd_table[0].macaddr, kernel_cmdline, 572 nvram_init(nvram, (uint8_t *)&nd_table[0].macaddr, kernel_cmdline,
570 boot_device, RAM_size, kernel_size, graphic_width, 573 boot_device, RAM_size, kernel_size, graphic_width,
571 - graphic_height, graphic_depth, hwdef->machine_id, "Sun4m"); 574 + graphic_height, graphic_depth, hwdef->nvram_machine_id,
  575 + "Sun4m");
572 576
573 if (hwdef->ecc_base != (target_phys_addr_t)-1) 577 if (hwdef->ecc_base != (target_phys_addr_t)-1)
574 ecc_init(hwdef->ecc_base, slavio_irq[hwdef->ecc_irq], 578 ecc_init(hwdef->ecc_base, slavio_irq[hwdef->ecc_irq],
@@ -576,6 +580,8 @@ static void sun4m_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size, @@ -576,6 +580,8 @@ static void sun4m_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size,
576 580
577 fw_cfg = fw_cfg_init(0, 0, CFG_ADDR, CFG_ADDR + 2); 581 fw_cfg = fw_cfg_init(0, 0, CFG_ADDR, CFG_ADDR + 2);
578 fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1); 582 fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
  583 + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
  584 + fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, hwdef->machine_id);
579 } 585 }
580 586
581 static void sun4c_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size, 587 static void sun4c_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size,
@@ -721,12 +727,30 @@ static void sun4c_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size, @@ -721,12 +727,30 @@ static void sun4c_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size,
721 727
722 nvram_init(nvram, (uint8_t *)&nd_table[0].macaddr, kernel_cmdline, 728 nvram_init(nvram, (uint8_t *)&nd_table[0].macaddr, kernel_cmdline,
723 boot_device, RAM_size, kernel_size, graphic_width, 729 boot_device, RAM_size, kernel_size, graphic_width,
724 - graphic_height, graphic_depth, hwdef->machine_id, "Sun4c"); 730 + graphic_height, graphic_depth, hwdef->nvram_machine_id,
  731 + "Sun4c");
725 732
726 fw_cfg = fw_cfg_init(0, 0, CFG_ADDR, CFG_ADDR + 2); 733 fw_cfg = fw_cfg_init(0, 0, CFG_ADDR, CFG_ADDR + 2);
727 fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1); 734 fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
  735 + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
  736 + fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, hwdef->machine_id);
728 } 737 }
729 738
  739 +enum {
  740 + ss2_id = 0,
  741 + ss5_id = 32,
  742 + vger_id,
  743 + lx_id,
  744 + ss4_id,
  745 + scls_id,
  746 + sbook_id,
  747 + ss10_id = 64,
  748 + ss20_id,
  749 + ss600mp_id,
  750 + ss1000_id = 96,
  751 + ss2000_id,
  752 +};
  753 +
730 static const struct hwdef hwdefs[] = { 754 static const struct hwdef hwdefs[] = {
731 /* SS-5 */ 755 /* SS-5 */
732 { 756 {
@@ -761,7 +785,8 @@ static const struct hwdef hwdefs[] = { @@ -761,7 +785,8 @@ static const struct hwdef hwdefs[] = {
761 .fd_irq = 22, 785 .fd_irq = 22,
762 .me_irq = 30, 786 .me_irq = 30,
763 .cs_irq = 5, 787 .cs_irq = 5,
764 - .machine_id = 0x80, 788 + .nvram_machine_id = 0x80,
  789 + .machine_id = ss5_id,
765 .iommu_version = 0x05000000, 790 .iommu_version = 0x05000000,
766 .intbit_to_level = { 791 .intbit_to_level = {
767 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12, 792 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12,
@@ -805,7 +830,8 @@ static const struct hwdef hwdefs[] = { @@ -805,7 +830,8 @@ static const struct hwdef hwdefs[] = {
805 .me_irq = 30, 830 .me_irq = 30,
806 .cs_irq = -1, 831 .cs_irq = -1,
807 .ecc_irq = 28, 832 .ecc_irq = 28,
808 - .machine_id = 0x72, 833 + .nvram_machine_id = 0x72,
  834 + .machine_id = ss10_id,
809 .iommu_version = 0x03000000, 835 .iommu_version = 0x03000000,
810 .intbit_to_level = { 836 .intbit_to_level = {
811 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12, 837 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12,
@@ -849,7 +875,8 @@ static const struct hwdef hwdefs[] = { @@ -849,7 +875,8 @@ static const struct hwdef hwdefs[] = {
849 .me_irq = 30, 875 .me_irq = 30,
850 .cs_irq = -1, 876 .cs_irq = -1,
851 .ecc_irq = 28, 877 .ecc_irq = 28,
852 - .machine_id = 0x71, 878 + .nvram_machine_id = 0x71,
  879 + .machine_id = ss600mp_id,
853 .iommu_version = 0x01000000, 880 .iommu_version = 0x01000000,
854 .intbit_to_level = { 881 .intbit_to_level = {
855 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12, 882 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12,
@@ -893,7 +920,8 @@ static const struct hwdef hwdefs[] = { @@ -893,7 +920,8 @@ static const struct hwdef hwdefs[] = {
893 .me_irq = 30, 920 .me_irq = 30,
894 .cs_irq = -1, 921 .cs_irq = -1,
895 .ecc_irq = 28, 922 .ecc_irq = 28,
896 - .machine_id = 0x72, 923 + .nvram_machine_id = 0x72,
  924 + .machine_id = ss20_id,
897 .iommu_version = 0x13000000, 925 .iommu_version = 0x13000000,
898 .intbit_to_level = { 926 .intbit_to_level = {
899 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12, 927 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12,
@@ -933,7 +961,8 @@ static const struct hwdef hwdefs[] = { @@ -933,7 +961,8 @@ static const struct hwdef hwdefs[] = {
933 .fd_irq = 1, 961 .fd_irq = 1,
934 .me_irq = 1, 962 .me_irq = 1,
935 .cs_irq = -1, 963 .cs_irq = -1,
936 - .machine_id = 0x55, 964 + .nvram_machine_id = 0x55,
  965 + .machine_id = ss2_id,
937 .max_mem = 0x10000000, 966 .max_mem = 0x10000000,
938 .default_cpu_model = "Cypress CY7C601", 967 .default_cpu_model = "Cypress CY7C601",
939 }, 968 },
@@ -970,7 +999,8 @@ static const struct hwdef hwdefs[] = { @@ -970,7 +999,8 @@ static const struct hwdef hwdefs[] = {
970 .fd_irq = 22, 999 .fd_irq = 22,
971 .me_irq = 30, 1000 .me_irq = 30,
972 .cs_irq = -1, 1001 .cs_irq = -1,
973 - .machine_id = 0x80, 1002 + .nvram_machine_id = 0x80,
  1003 + .machine_id = vger_id,
974 .iommu_version = 0x05000000, 1004 .iommu_version = 0x05000000,
975 .intbit_to_level = { 1005 .intbit_to_level = {
976 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12, 1006 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12,
@@ -1012,7 +1042,8 @@ static const struct hwdef hwdefs[] = { @@ -1012,7 +1042,8 @@ static const struct hwdef hwdefs[] = {
1012 .fd_irq = 22, 1042 .fd_irq = 22,
1013 .me_irq = 30, 1043 .me_irq = 30,
1014 .cs_irq = -1, 1044 .cs_irq = -1,
1015 - .machine_id = 0x80, 1045 + .nvram_machine_id = 0x80,
  1046 + .machine_id = lx_id,
1016 .iommu_version = 0x04000000, 1047 .iommu_version = 0x04000000,
1017 .intbit_to_level = { 1048 .intbit_to_level = {
1018 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12, 1049 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12,
@@ -1054,7 +1085,8 @@ static const struct hwdef hwdefs[] = { @@ -1054,7 +1085,8 @@ static const struct hwdef hwdefs[] = {
1054 .fd_irq = 22, 1085 .fd_irq = 22,
1055 .me_irq = 30, 1086 .me_irq = 30,
1056 .cs_irq = 5, 1087 .cs_irq = 5,
1057 - .machine_id = 0x80, 1088 + .nvram_machine_id = 0x80,
  1089 + .machine_id = ss4_id,
1058 .iommu_version = 0x05000000, 1090 .iommu_version = 0x05000000,
1059 .intbit_to_level = { 1091 .intbit_to_level = {
1060 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12, 1092 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12,
@@ -1096,7 +1128,8 @@ static const struct hwdef hwdefs[] = { @@ -1096,7 +1128,8 @@ static const struct hwdef hwdefs[] = {
1096 .fd_irq = 22, 1128 .fd_irq = 22,
1097 .me_irq = 30, 1129 .me_irq = 30,
1098 .cs_irq = -1, 1130 .cs_irq = -1,
1099 - .machine_id = 0x80, 1131 + .nvram_machine_id = 0x80,
  1132 + .machine_id = scls_id,
1100 .iommu_version = 0x05000000, 1133 .iommu_version = 0x05000000,
1101 .intbit_to_level = { 1134 .intbit_to_level = {
1102 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12, 1135 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12,
@@ -1138,7 +1171,8 @@ static const struct hwdef hwdefs[] = { @@ -1138,7 +1171,8 @@ static const struct hwdef hwdefs[] = {
1138 .fd_irq = 22, 1171 .fd_irq = 22,
1139 .me_irq = 30, 1172 .me_irq = 30,
1140 .cs_irq = -1, 1173 .cs_irq = -1,
1141 - .machine_id = 0x80, 1174 + .nvram_machine_id = 0x80,
  1175 + .machine_id = sbook_id,
1142 .iommu_version = 0x05000000, 1176 .iommu_version = 0x05000000,
1143 .intbit_to_level = { 1177 .intbit_to_level = {
1144 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12, 1178 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12,
@@ -1359,7 +1393,8 @@ static const struct sun4d_hwdef sun4d_hwdefs[] = { @@ -1359,7 +1393,8 @@ static const struct sun4d_hwdef sun4d_hwdefs[] = {
1359 .clock1_irq = 10, 1393 .clock1_irq = 10,
1360 .ms_kb_irq = 12, 1394 .ms_kb_irq = 12,
1361 .ser_irq = 12, 1395 .ser_irq = 12,
1362 - .machine_id = 0x80, 1396 + .nvram_machine_id = 0x80,
  1397 + .machine_id = ss1000_id,
1363 .iounit_version = 0x03000000, 1398 .iounit_version = 0x03000000,
1364 .max_mem = 0xf00000000ULL, 1399 .max_mem = 0xf00000000ULL,
1365 .default_cpu_model = "TI SuperSparc II", 1400 .default_cpu_model = "TI SuperSparc II",
@@ -1392,7 +1427,8 @@ static const struct sun4d_hwdef sun4d_hwdefs[] = { @@ -1392,7 +1427,8 @@ static const struct sun4d_hwdef sun4d_hwdefs[] = {
1392 .clock1_irq = 10, 1427 .clock1_irq = 10,
1393 .ms_kb_irq = 12, 1428 .ms_kb_irq = 12,
1394 .ser_irq = 12, 1429 .ser_irq = 12,
1395 - .machine_id = 0x80, 1430 + .nvram_machine_id = 0x80,
  1431 + .machine_id = ss2000_id,
1396 .iounit_version = 0x03000000, 1432 .iounit_version = 0x03000000,
1397 .max_mem = 0xf00000000ULL, 1433 .max_mem = 0xf00000000ULL,
1398 .default_cpu_model = "TI SuperSparc II", 1434 .default_cpu_model = "TI SuperSparc II",
@@ -1538,10 +1574,13 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size, @@ -1538,10 +1574,13 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size,
1538 1574
1539 nvram_init(nvram, (uint8_t *)&nd_table[0].macaddr, kernel_cmdline, 1575 nvram_init(nvram, (uint8_t *)&nd_table[0].macaddr, kernel_cmdline,
1540 boot_device, RAM_size, kernel_size, graphic_width, 1576 boot_device, RAM_size, kernel_size, graphic_width,
1541 - graphic_height, graphic_depth, hwdef->machine_id, "Sun4d"); 1577 + graphic_height, graphic_depth, hwdef->nvram_machine_id,
  1578 + "Sun4d");
1542 1579
1543 fw_cfg = fw_cfg_init(0, 0, CFG_ADDR, CFG_ADDR + 2); 1580 fw_cfg = fw_cfg_init(0, 0, CFG_ADDR, CFG_ADDR + 2);
1544 fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1); 1581 fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
  1582 + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
  1583 + fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, hwdef->machine_id);
1545 } 1584 }
1546 1585
1547 /* SPARCserver 1000 hardware initialisation */ 1586 /* SPARCserver 1000 hardware initialisation */
hw/sun4u.c
@@ -49,6 +49,7 @@ @@ -49,6 +49,7 @@
49 49
50 struct hwdef { 50 struct hwdef {
51 const char * const default_cpu_model; 51 const char * const default_cpu_model;
  52 + uint16_t machine_id;
52 }; 53 };
53 54
54 int DMA_get_channel_mode (int nchan) 55 int DMA_get_channel_mode (int nchan)
@@ -420,16 +421,25 @@ static void sun4uv_init(ram_addr_t RAM_size, int vga_ram_size, @@ -420,16 +421,25 @@ static void sun4uv_init(ram_addr_t RAM_size, int vga_ram_size,
420 421
421 fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0); 422 fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);
422 fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1); 423 fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
  424 + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
  425 + fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, hwdef->machine_id);
423 } 426 }
424 427
  428 +enum {
  429 + sun4u_id = 0,
  430 + sun4v_id = 64,
  431 +};
  432 +
425 static const struct hwdef hwdefs[] = { 433 static const struct hwdef hwdefs[] = {
426 /* Sun4u generic PC-like machine */ 434 /* Sun4u generic PC-like machine */
427 { 435 {
428 .default_cpu_model = "TI UltraSparc II", 436 .default_cpu_model = "TI UltraSparc II",
  437 + .machine_id = sun4u_id,
429 }, 438 },
430 /* Sun4v generic PC-like machine */ 439 /* Sun4v generic PC-like machine */
431 { 440 {
432 .default_cpu_model = "Sun UltraSparc T1", 441 .default_cpu_model = "Sun UltraSparc T1",
  442 + .machine_id = sun4v_id,
433 }, 443 },
434 }; 444 };
435 445