Skip to content

Commit

Permalink
Give variables in s8000/t8030 config more specific names
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualEhrmanntraut committed Jul 17, 2024
1 parent 0c87516 commit 6a4d304
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 90 deletions.
4 changes: 2 additions & 2 deletions hw/arm/apple-silicon/s8000-config.c.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
static uint8_t voltage_states1[] = {
static uint8_t s8000_voltage_states1[] = {
0x76, 0x86, 0x02, 0x00, 0x35, 0x02, 0x00, 0x00, 0xAA, 0xAA, 0x01,
0x00, 0x6D, 0x02, 0x00, 0x00, 0xB3, 0x18, 0x01, 0x00, 0xC8, 0x02,
0x00, 0x00, 0x55, 0xD5, 0x00, 0x00, 0xFD, 0x02, 0x00, 0x00, 0x4F,
Expand All @@ -7,7 +7,7 @@ static uint8_t voltage_states1[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};

static uint8_t clock_frequencies[] = {
static uint8_t s8000_clock_frequencies[] = {
0x00, 0x36, 0x6E, 0x01, 0x00, 0x10, 0x5E, 0x5F, 0x00, 0xA8, 0xD4, 0x55,
0x00, 0x8C, 0x86, 0x47, 0x00, 0x36, 0x6E, 0x01, 0x00, 0x36, 0x6E, 0x01,
0x00, 0x36, 0x6E, 0x01, 0x00, 0xE1, 0xF5, 0x05, 0x00, 0x7B, 0x9A, 0x17,
Expand Down
8 changes: 4 additions & 4 deletions hw/arm/apple-silicon/s8000.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,8 @@ static void s8000_pmgr_setup(MachineState *machine)
mem, -1);
}

set_dtb_prop(child, "voltage-states1", sizeof(voltage_states1),
voltage_states1);
set_dtb_prop(child, "voltage-states1", sizeof(s8000_voltage_states1),
s8000_voltage_states1);
}

static void s8000_create_nvme(MachineState *machine)
Expand Down Expand Up @@ -1233,8 +1233,8 @@ static void s8000_machine_init(MachineState *machine)
data = 0x0;
set_dtb_prop(child, "chip-revision", sizeof(data), &data);

set_dtb_prop(child, "clock-frequencies", sizeof(clock_frequencies),
clock_frequencies);
set_dtb_prop(child, "clock-frequencies", sizeof(s8000_clock_frequencies),
s8000_clock_frequencies);

prop = find_dtb_prop(child, "ranges");
g_assert_nonnull(prop);
Expand Down
58 changes: 29 additions & 29 deletions hw/arm/apple-silicon/t8030-config.c.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
static uint8_t voltage_states5[] = {
static uint8_t t8030_voltage_states5[] = {
0x12, 0xDA, 0x01, 0x00, 0x45, 0x02, 0x00, 0x00, 0xB3, 0x18, 0x01,
0x00, 0x7A, 0x02, 0x00, 0x00, 0x87, 0xC5, 0x00, 0x00, 0xB2, 0x02,
0x00, 0x00, 0xA2, 0x89, 0x00, 0x00, 0x19, 0x03, 0x00, 0x00, 0x37,
Expand All @@ -7,50 +7,50 @@ static uint8_t voltage_states5[] = {
0x00, 0x18, 0x60, 0x00, 0x00, 0x3F, 0x04, 0x00, 0x00,
};

static uint8_t voltage_states9_sram[] = {
static uint8_t t8030_voltage_states9_sram[] = {
0x00, 0x00, 0x00, 0x00, 0xF1, 0x02, 0x00, 0x00, 0x00, 0x2A, 0x75, 0x15,
0xF1, 0x02, 0x00, 0x00, 0xC0, 0x4F, 0xEF, 0x1E, 0xF1, 0x02, 0x00, 0x00,
0x00, 0xCD, 0x56, 0x27, 0xF1, 0x02, 0x00, 0x00, 0x00, 0x11, 0xEC, 0x2F,
0xF1, 0x02, 0x00, 0x00, 0x00, 0x55, 0x81, 0x38, 0x19, 0x03, 0x00, 0x00,
0x80, 0xFE, 0x2A, 0x47, 0x84, 0x03, 0x00, 0x00
};

static uint8_t voltage_states0[] = {
static uint8_t t8030_voltage_states0[] = {
0x01, 0x00, 0x00, 0x00, 0x77, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0xB8, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xEE, 0x02, 0x00, 0x00,
};

static uint8_t voltage_states9[] = {
static uint8_t t8030_voltage_states9[] = {
0x00, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x00, 0x2A, 0x75, 0x15,
0x48, 0x02, 0x00, 0x00, 0xC0, 0x4F, 0xEF, 0x1E, 0x77, 0x02, 0x00, 0x00,
0x00, 0xCD, 0x56, 0x27, 0x99, 0x02, 0x00, 0x00, 0x00, 0x11, 0xEC, 0x2F,
0xD1, 0x02, 0x00, 0x00, 0x00, 0x55, 0x81, 0x38, 0x19, 0x03, 0x00, 0x00,
0x80, 0xFE, 0x2A, 0x47, 0x84, 0x03, 0x00, 0x00,
};

static uint8_t voltage_states2[] = {
static uint8_t t8030_voltage_states2[] = {
0x01, 0x00, 0x00, 0x00, 0x74, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0xB5, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2C, 0x03, 0x00, 0x00,
};

static uint8_t voltage_states1_sram[] = {
static uint8_t t8030_voltage_states1_sram[] = {
0x00, 0x10, 0x55, 0x22, 0xF1, 0x02, 0x00, 0x00, 0x00, 0x98,
0x7F, 0x33, 0xF1, 0x02, 0x00, 0x00, 0x00, 0x20, 0xAA, 0x44,
0xF1, 0x02, 0x00, 0x00, 0x00, 0xA8, 0xD4, 0x55, 0x32, 0x03,
0x00, 0x00, 0x00, 0x30, 0xFF, 0x66, 0x99, 0x03, 0x00, 0x00,
};

static uint8_t voltage_states10[] = {
static uint8_t t8030_voltage_states10[] = {
0x01, 0x00, 0x00, 0x00, 0x7A, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0xA3, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xBF, 0x02, 0x00, 0x00,
};

static uint8_t voltage_states11[] = {
static uint8_t t8030_voltage_states11[] = {
0x01, 0x00, 0x00, 0x00, 0x45, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x7D, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xF4, 0x02, 0x00, 0x00,
};

static uint8_t voltage_states8[] = {
static uint8_t t8030_voltage_states8[] = {
0x00, 0xF4, 0x06, 0x14, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x2A, 0x75, 0x15,
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x6E, 0x0A, 0x1E, 0xFF, 0xFF, 0xFF, 0xFF,
0x00, 0xBF, 0x2F, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x1E, 0x7C, 0x29,
Expand All @@ -61,7 +61,7 @@ static uint8_t voltage_states8[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0xC9, 0x53, 0x53, 0xFF, 0xFF, 0xFF, 0xFF,
};

static uint8_t voltage_states5_sram[] = {
static uint8_t t8030_voltage_states5_sram[] = {
0x00, 0xBF, 0x2F, 0x20, 0xF1, 0x02, 0x00, 0x00, 0x00, 0x04, 0x5C,
0x36, 0xF1, 0x02, 0x00, 0x00, 0x00, 0x64, 0x3F, 0x4D, 0xF1, 0x02,
0x00, 0x00, 0x00, 0x59, 0xDD, 0x6E, 0x19, 0x03, 0x00, 0x00, 0x00,
Expand All @@ -70,19 +70,19 @@ static uint8_t voltage_states5_sram[] = {
0x00, 0x00, 0x6A, 0xC9, 0x9E, 0x3F, 0x04, 0x00, 0x00,
};

static uint8_t voltage_states1[] = {
static uint8_t t8030_voltage_states1[] = {
0x71, 0xBC, 0x01, 0x00, 0x61, 0x02, 0x00, 0x00, 0x4B, 0x28,
0x01, 0x00, 0x99, 0x02, 0x00, 0x00, 0x38, 0xDE, 0x00, 0x00,
0xDE, 0x02, 0x00, 0x00, 0xC7, 0xB1, 0x00, 0x00, 0x32, 0x03,
0x00, 0x00, 0x25, 0x94, 0x00, 0x00, 0x99, 0x03, 0x00, 0x00,
};

static uint8_t bridge_settings17[] = {
static uint8_t t8030_bridge_settings17[] = {
0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x01, 0xC0,
};

static uint8_t bridge_settings15[] = {
static uint8_t t8030_bridge_settings15[] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00,
0x98, 0x7E, 0x68, 0x01, 0x00, 0x0A, 0x00, 0x00, 0x01, 0x00, 0x01, 0x40,
0x24, 0x0A, 0x00, 0x00, 0x18, 0x08, 0x08, 0x00, 0x44, 0x0A, 0x00, 0x00,
Expand All @@ -97,7 +97,7 @@ static uint8_t bridge_settings15[] = {
0x0F, 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x01, 0x00, 0x01, 0xC0,
};

static uint8_t bridge_settings13[] = {
static uint8_t t8030_bridge_settings13[] = {
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00,
0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04,
Expand All @@ -106,7 +106,7 @@ static uint8_t bridge_settings13[] = {
0x00, 0x48, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
};

static uint8_t bridge_settings1[] = {
static uint8_t t8030_bridge_settings1[] = {
0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x01, 0x00, 0x01, 0x40, 0x00, 0x06, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x01,
0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0C, 0x07, 0x00, 0x00,
Expand All @@ -120,7 +120,7 @@ static uint8_t bridge_settings1[] = {
0x00, 0x08, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
};

static uint8_t bridge_settings5[] = {
static uint8_t t8030_bridge_settings5[] = {
0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x01, 0x00, 0x00, 0x40, 0x00, 0x06, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x01,
0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0C, 0x07, 0x00, 0x00,
Expand All @@ -138,7 +138,7 @@ static uint8_t bridge_settings5[] = {
0x00, 0x08, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
};

static uint8_t bridge_settings6[] = {
static uint8_t t8030_bridge_settings6[] = {
0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x01, 0x00, 0x01, 0x40, 0x00, 0x06, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x01,
0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0C, 0x07, 0x00, 0x00,
Expand All @@ -152,7 +152,7 @@ static uint8_t bridge_settings6[] = {
0x00, 0x08, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
};

static uint8_t bridge_settings2[] = {
static uint8_t t8030_bridge_settings2[] = {
0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x01, 0x00, 0x01, 0x40, 0x00, 0x06, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x01,
0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0C, 0x07, 0x00, 0x00,
Expand All @@ -166,22 +166,22 @@ static uint8_t bridge_settings2[] = {
0x00, 0x08, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
};

static uint8_t bridge_settings16[] = {
static uint8_t t8030_bridge_settings16[] = {
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x0C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x01, 0x00, 0x01, 0xC0,
};

static uint8_t bridge_settings14[] = {
static uint8_t t8030_bridge_settings14[] = {
0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x01, 0x00, 0x01, 0xC0, 0x28, 0x02, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0x01, 0x00,
0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
};

static uint8_t bridge_settings7[] = {
static uint8_t t8030_bridge_settings7[] = {
0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x01, 0x00, 0x01, 0x40, 0x00, 0x06, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x01,
0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0C, 0x07, 0x00, 0x00,
Expand All @@ -191,7 +191,7 @@ static uint8_t bridge_settings7[] = {
0x00, 0x08, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
};

static uint8_t bridge_settings12[] = {
static uint8_t t8030_bridge_settings12[] = {
0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00,
0xE8, 0x7C, 0x18, 0x03, 0x54, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x01, 0x00, 0x01, 0x40, 0x24, 0x09, 0x00, 0x00,
Expand All @@ -210,7 +210,7 @@ static uint8_t bridge_settings12[] = {
0x01, 0x00, 0x00, 0x00, 0x48, 0x82, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
};

static uint8_t bridge_settings3[] = {
static uint8_t t8030_bridge_settings3[] = {
0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x01, 0x00, 0x01, 0x40, 0x00, 0x06, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x01,
0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0C, 0x07, 0x00, 0x00,
Expand All @@ -224,7 +224,7 @@ static uint8_t bridge_settings3[] = {
0x00, 0x08, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
};

static uint8_t bridge_settings8[] = {
static uint8_t t8030_bridge_settings8[] = {
0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x01, 0x00, 0x01, 0x40, 0x00, 0x06, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x01,
0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0C, 0x07, 0x00, 0x00,
Expand All @@ -238,7 +238,7 @@ static uint8_t bridge_settings8[] = {
0x00, 0x08, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
};

static uint8_t bridge_settings4[] = {
static uint8_t t8030_bridge_settings4[] = {
0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x01, 0x00, 0x00, 0x40, 0x00, 0x06, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x01,
0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0C, 0x07, 0x00, 0x00,
Expand All @@ -252,7 +252,7 @@ static uint8_t bridge_settings4[] = {
0x00, 0x08, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
};

static uint8_t bridge_settings0[] = {
static uint8_t t8030_bridge_settings0[] = {
0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x01, 0x00, 0x01, 0x40, 0x00, 0x06, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x01,
0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0C, 0x07, 0x00, 0x00,
Expand All @@ -266,7 +266,7 @@ static uint8_t bridge_settings0[] = {
0x00, 0x08, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
};

static uint8_t clock_freq[] = {
static uint8_t t8030_clock_freq[] = {
0x00, 0x36, 0x6E, 0x01, 0x00, 0x80, 0x00, 0x00, 0x00, 0x40, 0x6E, 0x01,
0x00, 0x00, 0x2A, 0x11, 0x00, 0x10, 0x5E, 0x5F, 0x00, 0xA8, 0xD4, 0x55,
0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0x42, 0x57, 0x00, 0xD2, 0x49, 0x6B,
Expand Down Expand Up @@ -302,14 +302,14 @@ static uint8_t clock_freq[] = {
0x00, 0xE9, 0xA4, 0x35, 0x00, 0xE9, 0xA4, 0x35, 0x00, 0xE9, 0xA4, 0x35,
};

static uint32_t spi_cs_pins[] = {
static uint32_t t8030_spi_cs_pins[] = {
204,
95,
-1,
66,
};

static uint32_t spi_irqs[] = {
static uint32_t t8030_spi_irqs[] = {
444,
445,
446,
Expand Down
Loading

0 comments on commit 6a4d304

Please sign in to comment.