* [PATCH 0 of 2] [RESEND] [PowerPC] Fix setting memory for bamboo board model
@ 2008-05-05 16:04 Jerone Young
2008-05-05 16:04 ` [PATCH 1 of 2] Add function dt_cell_multi to hw/device_tree.c Jerone Young
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Jerone Young @ 2008-05-05 16:04 UTC (permalink / raw)
To: kvm-devel; +Cc: kvm-ppc-devel
These patches fell through the cracks.
This set of patches fixes setting memory for PowerPC bamboo board model. Besides just setting memory in qemu, you must also set it in the device tree. This sets the memory in the device tree so that it can be something other then the hard coded memory size of 144MB.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1 of 2] Add function dt_cell_multi to hw/device_tree.c
2008-05-05 16:04 [PATCH 0 of 2] [RESEND] [PowerPC] Fix setting memory for bamboo board model Jerone Young
@ 2008-05-05 16:04 ` Jerone Young
2008-05-05 16:04 ` [PATCH 2 of 2] Fix memory defined in device tree by declaring it dynamically for bamboo board model Jerone Young
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Jerone Young @ 2008-05-05 16:04 UTC (permalink / raw)
To: kvm-devel; +Cc: kvm-ppc-devel
# HG changeset patch
# User Jerone Young <jyoung5@us.ibm.com>
# Date 1210003408 18000
# Branch merge
# Node ID cf3ccc3add69052aade695c746151b1cb8812252
# Parent 97e439fdd4e91c3fb1ef9055f073add55084d69f
Add function dt_cell_multi to hw/device_tree.c
This patch adds function dt_cell_multi to allow for manipulation of device tree properties that contain mulitiple 32bit values.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
diff --git a/qemu/hw/device_tree.c b/qemu/hw/device_tree.c
--- a/qemu/hw/device_tree.c
+++ b/qemu/hw/device_tree.c
@@ -162,6 +162,21 @@ void dt_cell(void *fdt, char *node_path,
}
}
+/* This function is to manipulate a cell with multiple values */
+void dt_cell_multi(void *fdt, char *node_path, char *property,
+ uint32_t *val_array, int size)
+{
+ int offset;
+ int ret;
+ offset = get_offset_of_node(fdt, node_path);
+ ret = fdt_setprop(fdt, offset, property, val_array, size);
+ if (ret < 0) {
+ printf("Unable to set device tree property '%s'\n",
+ property);
+ exit(1);
+ }
+}
+
void dt_string(void *fdt, char *node_path, char *property,
char *string)
{
diff --git a/qemu/hw/device_tree.h b/qemu/hw/device_tree.h
--- a/qemu/hw/device_tree.h
+++ b/qemu/hw/device_tree.h
@@ -19,6 +19,8 @@ void dump_device_tree_to_file(void *fdt,
void dump_device_tree_to_file(void *fdt, char *filename);
void dt_cell(void *fdt, char *node_path, char *property,
uint32_t val);
+void dt_cell_multi(void *fdt, char *node_path, char *property,
+ uint32_t *val_array, int size);
void dt_string(void *fdt, char *node_path, char *property,
char *string);
void dt_node(void *fdt, char *node_parent_path, char *name);
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2 of 2] Fix memory defined in device tree by declaring it dynamically for bamboo board model
2008-05-05 16:04 [PATCH 0 of 2] [RESEND] [PowerPC] Fix setting memory for bamboo board model Jerone Young
2008-05-05 16:04 ` [PATCH 1 of 2] Add function dt_cell_multi to hw/device_tree.c Jerone Young
@ 2008-05-05 16:04 ` Jerone Young
2008-05-05 18:00 ` [kvm-ppc-devel] [PATCH 0 of 2] [RESEND] [PowerPC] Fix setting memory " Hollis Blanchard
2008-05-06 14:58 ` Avi Kivity
3 siblings, 0 replies; 5+ messages in thread
From: Jerone Young @ 2008-05-05 16:04 UTC (permalink / raw)
To: kvm-devel; +Cc: kvm-ppc-devel
# HG changeset patch
# User Jerone Young <jyoung5@us.ibm.com>
# Date 1210003411 18000
# Branch merge
# Node ID c455452c9b217abed8a2e6147bbeb91f33ff1799
# Parent cf3ccc3add69052aade695c746151b1cb8812252
Fix memory defined in device tree by declaring it dynamically for bamboo board model
This fixes a issue where the amount of memory is not properly being defined in the device tree. It currently is hardcoded for 144MB. The result is that if you specify a memory size below the hardcoded size, the guest crashes. This patch now dynamically changes the device tree to the memory value specified.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c
--- a/qemu/hw/ppc440_bamboo.c
+++ b/qemu/hw/ppc440_bamboo.c
@@ -50,6 +50,7 @@ void bamboo_init(ram_addr_t ram_size, in
int i=0, k=0;
uint32_t cpu_freq;
uint32_t timebase_freq;
+ uint32_t mem_reg_property[]={0, 0, ram_size};
printf("%s: START\n", __func__);
@@ -73,6 +74,7 @@ void bamboo_init(ram_addr_t ram_size, in
printf("WARNING: %i MB left over memory is ram\n",
bytes_to_mb((int)tmp_ram_size));
ram_size -= tmp_ram_size;
+ mem_reg_property[2] = ram_size;
}
/* Setup CPU */
@@ -159,6 +161,8 @@ void bamboo_init(ram_addr_t ram_size, in
/* manipulate device tree in memory */
dt_cell(fdt, "/cpus/cpu@0", "clock-frequency", cpu_freq);
dt_cell(fdt, "/cpus/cpu@0", "timebase-frequency", timebase_freq);
+ dt_cell_multi(fdt, "/memory", "reg", mem_reg_property,
+ sizeof(mem_reg_property));
dt_cell(fdt, "/chosen", "linux,initrd-start", initrd_base);
dt_cell(fdt, "/chosen", "linux,initrd-end",
(initrd_base + initrd_size));
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [kvm-ppc-devel] [PATCH 0 of 2] [RESEND] [PowerPC] Fix setting memory for bamboo board model
2008-05-05 16:04 [PATCH 0 of 2] [RESEND] [PowerPC] Fix setting memory for bamboo board model Jerone Young
2008-05-05 16:04 ` [PATCH 1 of 2] Add function dt_cell_multi to hw/device_tree.c Jerone Young
2008-05-05 16:04 ` [PATCH 2 of 2] Fix memory defined in device tree by declaring it dynamically for bamboo board model Jerone Young
@ 2008-05-05 18:00 ` Hollis Blanchard
2008-05-06 14:58 ` Avi Kivity
3 siblings, 0 replies; 5+ messages in thread
From: Hollis Blanchard @ 2008-05-05 18:00 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm-ppc-devel, kvm-devel, Jerone Young
On Monday 05 May 2008 11:04:52 Jerone Young wrote:
> These patches fell through the cracks.
>
> This set of patches fixes setting memory for PowerPC bamboo board model.
Besides just setting memory in qemu, you must also set it in the device tree.
This sets the memory in the device tree so that it can be something other
then the hard coded memory size of 144MB.
>
> Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
Acked-by: Hollis Blanchard <hollisb@us.ibm.com>
Avi, please apply to kvm-userspace; thanks.
--
Hollis Blanchard
IBM Linux Technology Center
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0 of 2] [RESEND] [PowerPC] Fix setting memory for bamboo board model
2008-05-05 16:04 [PATCH 0 of 2] [RESEND] [PowerPC] Fix setting memory for bamboo board model Jerone Young
` (2 preceding siblings ...)
2008-05-05 18:00 ` [kvm-ppc-devel] [PATCH 0 of 2] [RESEND] [PowerPC] Fix setting memory " Hollis Blanchard
@ 2008-05-06 14:58 ` Avi Kivity
3 siblings, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2008-05-06 14:58 UTC (permalink / raw)
To: Jerone Young; +Cc: kvm-devel, kvm-ppc-devel
Jerone Young wrote:
> These patches fell through the cracks.
>
Unfortunately, the cracks are getting wider.
Anyway, applied, thanks.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-05-06 14:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-05 16:04 [PATCH 0 of 2] [RESEND] [PowerPC] Fix setting memory for bamboo board model Jerone Young
2008-05-05 16:04 ` [PATCH 1 of 2] Add function dt_cell_multi to hw/device_tree.c Jerone Young
2008-05-05 16:04 ` [PATCH 2 of 2] Fix memory defined in device tree by declaring it dynamically for bamboo board model Jerone Young
2008-05-05 18:00 ` [kvm-ppc-devel] [PATCH 0 of 2] [RESEND] [PowerPC] Fix setting memory " Hollis Blanchard
2008-05-06 14:58 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox