Skip to contentSkip to conversation

hw/misc: fix Aspeed SCU hw-strap2 property

PATCH In review Cédric Le Goater 2 participants 7 messages Jun 30, 2016 – Jul 1, 2016 Arm/Aspeed machine support

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 hw/misc: fix Aspeed SCU hw-strap2 property

These strap registers are complex enough, let's not mix them.

---
 hw/misc/aspeed_scu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/misc/aspeed_scu.c +1 -1
index 4f9df581e70a..14b2d75e6049 100644
@@ -254,7 +254,7 @@ static const VMStateDescription vmstate_aspeed_scu = {
 static Property aspeed_scu_properties[] = {
     DEFINE_PROP_UINT32("silicon-rev", AspeedSCUState, silicon_rev, 0),
     DEFINE_PROP_UINT32("hw-strap1", AspeedSCUState, hw_strap1, 0),
-    DEFINE_PROP_UINT32("hw-strap2", AspeedSCUState, hw_strap1, 0),
+    DEFINE_PROP_UINT32("hw-strap2", AspeedSCUState, hw_strap2, 0),
     DEFINE_PROP_END_OF_LIST(),
 };
 
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/2 hw/misc: use macros to define hw-strap1 register on Aspeed SOC

This gives some explanation behind the magic number 0x120CE416.

---
 hw/arm/palmetto-bmc.c        | 16 ++++++++-
 include/hw/misc/aspeed_scu.h | 78 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+), 1 deletion(-)
hw/arm/palmetto-bmc.c +15 -1
index fcbb4f197162..8fac67617825 100644
@@ -22,6 +22,19 @@
 #include "sysemu/blockdev.h"
 #include "hw/block/flash.h"
 
+#define PALMETTO_BMC_HW_STRAP1 (                                        \
+        SCU_HW_STRAP_DRAM_SIZE(DRAM_SIZE_256MB) |                       \
+        SCU_HW_STRAP_DRAM_CONFIG(2 /* DDR3 with CL=6, CWL=5 */) |       \
+        SCU_HW_STRAP_ACPI_DIS |                                         \
+        SCU_HW_STRAP_SET_CLK_SOURCE(CLK_48M_IN) |                       \
+        SCU_HW_STRAP_VGA_CLASS_CODE |                                   \
+        SCU_HW_STRAP_LPC_RESET_PIN |                                    \
+        SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_M_S_EN) |                \
+        SCU_HW_STRAP_SET_CPU_AHB_RATIO(CPU_AHB_RATIO_2_1) |             \
+        SCU_HW_STRAP_SPI_WIDTH |                                        \
+        SCU_HW_STRAP_VGA_SIZE_SET(VGA_16M_DRAM) |                       \
+        SCU_HW_STRAP_BOOT_MODE(SPI_BOOT))
+
 static struct arm_boot_info palmetto_bmc_binfo = {
     .loader_start = AST2400_SDRAM_BASE,
     .board_id = 0,
@@ -77,7 +90,8 @@ static void palmetto_bmc_init(MachineState *machine)
                                 &bmc->ram);
     object_property_add_const_link(OBJECT(&bmc->soc), "ram", OBJECT(&bmc->ram),
                                    &error_abort);
-    object_property_set_int(OBJECT(&bmc->soc), 0x120CE416, "hw-strap1",
+    object_property_set_int(OBJECT(&bmc->soc), PALMETTO_BMC_HW_STRAP1,
+                            "hw-strap1",
                             &error_abort);
     object_property_set_bool(OBJECT(&bmc->soc), true, "realized",
                              &error_abort);
include/hw/misc/aspeed_scu.h +78 -0

82 lines not on this page · raw message

Signature · 1 line
2.1.4
#3 lore raw
Quoted 7 lines · Peter Maydell
Quoted 3 lines · Cédric Le Goater

These strap registers are complex enough, let's not mix them.

Was there a cover letter for this patchset? I can't find it in my email...

Ah :/ No, I didn't send one as the patches were small and self contained. Should we each time ?

Thanks,

C.

#4 lore raw
Quoted 11 lines · Cédric Le Goater
Quoted 7 lines · Peter Maydell
Quoted 3 lines · Cédric Le Goater

These strap registers are complex enough, let's not mix them.

Was there a cover letter for this patchset? I can't find it in my email...

Ah :/ No, I didn't send one as the patches were small and self contained. Should we each time ?

Let me rework that if possible. I need to add a few things.

Thanks,

C.

#5 lore raw
In reply to Cédric Le Goater
Quoted 11 lines · Cédric Le Goater
Quoted 7 lines · Peter Maydell
Quoted 3 lines · Cédric Le Goater

These strap registers are complex enough, let's not mix them.

Was there a cover letter for this patchset? I can't find it in my email...

Ah :/ No, I didn't send one as the patches were small and self contained. Should we each time ?

The basic rule is that single standalone patches don't need a cover letter; a series with more than one patch should have a cover letter. Some of our automated tooling gets confused otherwise (also I like to be able to have a single email to mark for attention in my mail client). These confused me a bit because they had the series indicators in the subject (1/2, 2/2) but no cover.

thanks
-- PMM

#6 lore raw
Quoted 13 lines · Peter Maydell
Quoted 11 lines · Cédric Le Goater
Quoted 7 lines · Peter Maydell
Quoted 3 lines · Cédric Le Goater

These strap registers are complex enough, let's not mix them.

Was there a cover letter for this patchset? I can't find it in my email...

Ah :/ No, I didn't send one as the patches were small and self contained. Should we each time ?

Quoted 7 lines

The basic rule is that single standalone patches don't need a cover letter; a series with more than one patch should have a cover letter. Some of our automated tooling gets confused otherwise (also I like to be able to have a single email to mark for attention in my mail client). These confused me a bit because they had the series indicators in the subject (1/2, 2/2) but no cover.

Yes, the email threading was a bit confusing in my mail client also. Sorry about that.

I will resend with a cover letter. I need to add where the macros are coming from.

Thanks,

C.