diff mbox

[v2] mac99: Added FW_CFG_PPC_BUSFREQ to match CLOCKFREQ and TBFREQ already there

Message ID 20140417193413.D1F132F437@mono.eik.bme.hu
State New
Headers show

Commit Message

BALATON Zoltan April 17, 2014, 5:04 p.m. UTC
While there, also moved the hard coded value for CLOCKFREQ to a #define.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---

 v2: Also include mac_oldworld that I missed in the first version and
 fix commit message
 
 hw/ppc/mac_newworld.c | 5 ++++-
 hw/ppc/mac_oldworld.c | 5 ++++-
 include/hw/ppc/ppc.h  | 2 ++
 3 files changed, 10 insertions(+), 2 deletions(-)

Comments

BALATON Zoltan May 7, 2014, 10:11 a.m. UTC | #1
Ping?

On Thu, 17 Apr 2014, BALATON Zoltan wrote:
> While there, also moved the hard coded value for CLOCKFREQ to a #define.
>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> ---
>
> v2: Also include mac_oldworld that I missed in the first version and
> fix commit message
>
> hw/ppc/mac_newworld.c | 5 ++++-
> hw/ppc/mac_oldworld.c | 5 ++++-
> include/hw/ppc/ppc.h  | 2 ++
> 3 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
> index a533ec7..c937ff1 100644
> --- a/hw/ppc/mac_newworld.c
> +++ b/hw/ppc/mac_newworld.c
> @@ -72,6 +72,8 @@
> #define MAX_IDE_BUS 2
> #define CFG_ADDR 0xf0000510
> #define TBFREQ (100UL * 1000UL * 1000UL)
> +#define CLOCKFREQ (266UL * 1000UL * 1000UL)
> +#define BUSFREQ (100UL * 1000UL * 1000UL)
>
> /* debug UniNorth */
> //#define DEBUG_UNIN
> @@ -469,7 +471,8 @@ static void ppc_core99_init(QEMUMachineInitArgs *args)
>         fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, TBFREQ);
>     }
>     /* Mac OS X requires a "known good" clock-frequency value; pass it one. */
> -    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_CLOCKFREQ, 266000000);
> +    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_CLOCKFREQ, CLOCKFREQ);
> +    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_BUSFREQ, BUSFREQ);
>
>     qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
> }
> diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
> index 2f27754..5de9223 100644
> --- a/hw/ppc/mac_oldworld.c
> +++ b/hw/ppc/mac_oldworld.c
> @@ -46,6 +46,8 @@
> #define MAX_IDE_BUS 2
> #define CFG_ADDR 0xf0000510
> #define TBFREQ 16600000UL
> +#define CLOCKFREQ 266000000UL
> +#define BUSFREQ 66000000UL
>
> static int fw_cfg_boot_set(void *opaque, const char *boot_device)
> {
> @@ -337,7 +339,8 @@ static void ppc_heathrow_init(QEMUMachineInitArgs *args)
>         fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, TBFREQ);
>     }
>     /* Mac OS X requires a "known good" clock-frequency value; pass it one. */
> -    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_CLOCKFREQ, 266000000);
> +    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_CLOCKFREQ, CLOCKFREQ);
> +    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_BUSFREQ, BUSFREQ);
>
>     qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
> }
> diff --git a/include/hw/ppc/ppc.h b/include/hw/ppc/ppc.h
> index d71bd07..7e16e2e 100644
> --- a/include/hw/ppc/ppc.h
> +++ b/include/hw/ppc/ppc.h
> @@ -92,6 +92,8 @@ enum {
> #define FW_CFG_PPC_IS_KVM       (FW_CFG_ARCH_LOCAL + 0x05)
> #define FW_CFG_PPC_KVM_HC       (FW_CFG_ARCH_LOCAL + 0x06)
> #define FW_CFG_PPC_KVM_PID      (FW_CFG_ARCH_LOCAL + 0x07)
> +/* OpenBIOS has FW_CFG_PPC_NVRAM_ADDR as +0x08 */
> +#define FW_CFG_PPC_BUSFREQ      (FW_CFG_ARCH_LOCAL + 0x09)
>
> #define PPC_SERIAL_MM_BAUDBASE 399193
>
> -- 
> 1.8.1.5
>
>
>
Alexander Graf May 8, 2014, 9:08 a.m. UTC | #2
On 04/17/2014 07:04 PM, BALATON Zoltan wrote:
> While there, also moved the hard coded value for CLOCKFREQ to a #define.
>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>

Thanks, applied to ppc-next.


Alex
diff mbox

Patch

diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index a533ec7..c937ff1 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -72,6 +72,8 @@ 
 #define MAX_IDE_BUS 2
 #define CFG_ADDR 0xf0000510
 #define TBFREQ (100UL * 1000UL * 1000UL)
+#define CLOCKFREQ (266UL * 1000UL * 1000UL)
+#define BUSFREQ (100UL * 1000UL * 1000UL)
 
 /* debug UniNorth */
 //#define DEBUG_UNIN
@@ -469,7 +471,8 @@  static void ppc_core99_init(QEMUMachineInitArgs *args)
         fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, TBFREQ);
     }
     /* Mac OS X requires a "known good" clock-frequency value; pass it one. */
-    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_CLOCKFREQ, 266000000);
+    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_CLOCKFREQ, CLOCKFREQ);
+    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_BUSFREQ, BUSFREQ);
 
     qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
 }
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 2f27754..5de9223 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -46,6 +46,8 @@ 
 #define MAX_IDE_BUS 2
 #define CFG_ADDR 0xf0000510
 #define TBFREQ 16600000UL
+#define CLOCKFREQ 266000000UL
+#define BUSFREQ 66000000UL
 
 static int fw_cfg_boot_set(void *opaque, const char *boot_device)
 {
@@ -337,7 +339,8 @@  static void ppc_heathrow_init(QEMUMachineInitArgs *args)
         fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, TBFREQ);
     }
     /* Mac OS X requires a "known good" clock-frequency value; pass it one. */
-    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_CLOCKFREQ, 266000000);
+    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_CLOCKFREQ, CLOCKFREQ);
+    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_BUSFREQ, BUSFREQ);
 
     qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
 }
diff --git a/include/hw/ppc/ppc.h b/include/hw/ppc/ppc.h
index d71bd07..7e16e2e 100644
--- a/include/hw/ppc/ppc.h
+++ b/include/hw/ppc/ppc.h
@@ -92,6 +92,8 @@  enum {
 #define FW_CFG_PPC_IS_KVM       (FW_CFG_ARCH_LOCAL + 0x05)
 #define FW_CFG_PPC_KVM_HC       (FW_CFG_ARCH_LOCAL + 0x06)
 #define FW_CFG_PPC_KVM_PID      (FW_CFG_ARCH_LOCAL + 0x07)
+/* OpenBIOS has FW_CFG_PPC_NVRAM_ADDR as +0x08 */
+#define FW_CFG_PPC_BUSFREQ      (FW_CFG_ARCH_LOCAL + 0x09)
 
 #define PPC_SERIAL_MM_BAUDBASE 399193