diff mbox

[RFC]

Message ID 49B19AE0.3080609@embeddedarm.com (mailing list archive)
State Changes Requested, archived
Headers show

Commit Message

Eddie Dawydiuk March 6, 2009, 9:51 p.m. UTC
Hello,

> Your patch is word-wrapped.  It also lacks the Signed-off-by tag, which
> is required.

I apologize please see an updated patch below.

> The changelog sounds as if there are bugs being fixed here, but really
> you're adding support for something entirely new.  The yosemite board
> comes with U-Boot, which uses uImages.  You seem to be adding support
> for using simpleboot on the Yosemite board.  Is that correct?

Yes, the patch ensures the simpleboot image works on the Yosemite board. I was 
under the impression the code was broken as one can build a simpleImage for the 
Yosemite board as described in Documentation/powerpc/bootwrapper.txt without any 
modification on a vanilla kernel, although the resulting image does not work 
without the following patches.

 > You can't do this.  If you hard code the MAC address of whatever board
 > you are using in the kernel, everyone will have to edit it.  You need
 > to specify this in your board DTS file or via some other configurable
 > mechansim.

Oops, sorry I forgot to pull out the debug code...

Signed-off-by: Eddie Dawydiuk <eddie@embeddedarm.com>

diff -urN linux-2.6.28.orig/arch/powerpc/boot/Makefile 
linux-2.6.28/arch/powerpc/boot/Makefile
--- linux-2.6.28.orig/arch/powerpc/boot/Makefile        2008-12-24 
16:26:37.000000000 -0700
+++ linux-2.6.28/arch/powerpc/boot/Makefile     2009-03-05 17:35:53.000000000 -0700
@@ -70,7 +70,7 @@
                 cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \
                 cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \
                 virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \
-               cuboot-acadia.c
+               cuboot-acadia.c simpleboot-yosemite.c
  src-boot := $(src-wlib) $(src-plat) empty.c

  src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -224,7 +224,7 @@
  image-$(CONFIG_TAISHAN)                        += cuImage.taishan
  image-$(CONFIG_KATMAI)                 += cuImage.katmai
  image-$(CONFIG_WARP)                   += cuImage.warp
-image-$(CONFIG_YOSEMITE)               += cuImage.yosemite
+image-$(CONFIG_YOSEMITE)               += cuImage.yosemite simpleImage.yosemite

  # Board ports in arch/powerpc/platform/8xx/Kconfig
  image-$(CONFIG_MPC86XADS)

  asp834x-redboot)

diff -urN linux-2.6.28.orig/arch/powerpc/boot/simpleboot-yosemite.c 
linux-2.6.28/arch/powerpc/boot/simpleboot-yosemite.c
--- linux-2.6.28.orig/arch/powerpc/boot/simpleboot-yosemite.c   1969-12-31 
17:00:00.000000000 -0700
+++ linux-2.6.28/arch/powerpc/boot/simpleboot-yosemite.c        2009-03-06 
14:55:46.000000000 -0700
@@ -0,0 +1,24 @@
+#include "ops.h"
+#include "stdio.h"
+#include "4xx.h"
+#include "44x.h"
+
+#define TARGET_4xx
+#define TARGET_44x
+#include "ppcboot.h"
+
+static void yosemite_fixups(void)
+{
+       unsigned long sysclk = 50000000;
+
+       ibm440ep_fixup_clocks(sysclk, 11059200, 400000000);
+       ibm4xx_sdram_fixup_memsize();
+       dt_fixup_mac_address_by_alias("ethernet0", eth0adr);
+       dt_fixup_mac_address_by_alias("ethernet1", eth1adr);
+}
+
+void platform_specific_init(void)
+{
+       platform_ops.fixups = yosemite_fixups;
+       platform_ops.exit = ibm44x_dbcr_reset;
+}

Comments

Eddie Dawydiuk March 6, 2009, 10:32 p.m. UTC | #1
Hello,

Let's try this one more time. The last patch was using the clocks for a custom 
board based on the Yosemite board and was referencing a non-existent ethNadr( I 
forgot to pull out this code out).

Signed-off-by: Eddie Dawydiuk <eddie@embeddedarm.com>

diff -urN linux-2.6.28.orig/arch/powerpc/boot/simpleboot-yosemite.c 
linux-2.6.28/arch/powerpc/boot/simpleboot-yosemite.c
--- linux-2.6.28.orig/arch/powerpc/boot/simpleboot-yosemite.c   1969-12-31 
17:00:00.000000000 -0700
+++ linux-2.6.28/arch/powerpc/boot/simpleboot-yosemite.c        2009-03-06 
15:33:24.000000000 -0700
@@ -0,0 +1,23 @@
+#include "ops.h"
+#include "stdio.h"
+#include "4xx.h"
+#include "44x.h"
+
+#define TARGET_4xx
+#define TARGET_44x
+#include "ppcboot.h"
+
+static void yosemite_fixups(void)
+{
+       unsigned long sysclk = 66666666;
+
+       ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
+       ibm4xx_sdram_fixup_memsize();
+}
+
+void platform_specific_init(void)
+{
+       platform_ops.fixups = yosemite_fixups;
+       platform_ops.exit = ibm44x_dbcr_reset;
+}

> diff -urN linux-2.6.28.orig/arch/powerpc/boot/simpleboot-yosemite.c 
> linux-2.6.28/arch/powerpc/boot/simpleboot-yosemite.c
> --- linux-2.6.28.orig/arch/powerpc/boot/simpleboot-yosemite.c   
> 1969-12-31 17:00:00.000000000 -0700
> +++ linux-2.6.28/arch/powerpc/boot/simpleboot-yosemite.c        
> 2009-03-06 14:55:46.000000000 -0700
> @@ -0,0 +1,24 @@
> +#include "ops.h"
> +#include "stdio.h"
> +#include "4xx.h"
> +#include "44x.h"
> +
> +#define TARGET_4xx
> +#define TARGET_44x
> +#include "ppcboot.h"
> +
> +static void yosemite_fixups(void)
> +{
> +       unsigned long sysclk = 50000000;
> +
> +       ibm440ep_fixup_clocks(sysclk, 11059200, 400000000);
> +       ibm4xx_sdram_fixup_memsize();
> +       dt_fixup_mac_address_by_alias("ethernet0", eth0adr);
> +       dt_fixup_mac_address_by_alias("ethernet1", eth1adr);
> +}
> +
> +void platform_specific_init(void)
> +{
> +       platform_ops.fixups = yosemite_fixups;
> +       platform_ops.exit = ibm44x_dbcr_reset;
> +}
>
Grant Likely March 7, 2009, 4:22 a.m. UTC | #2
On Fri, Mar 6, 2009 at 3:32 PM, Eddie Dawydiuk <eddie@embeddedarm.com> wrote:
> Hello,
>
> Let's try this one more time. The last patch was using the clocks for a
> custom board based on the Yosemite board and was referencing a non-existent
> ethNadr( I forgot to pull out this code out).

But the question remains: Why do you need simpleboot support for
Yosemite when you can use a uImage or cuImage with u-boot?

g.

>
> Signed-off-by: Eddie Dawydiuk <eddie@embeddedarm.com>
>
> diff -urN linux-2.6.28.orig/arch/powerpc/boot/simpleboot-yosemite.c
> linux-2.6.28/arch/powerpc/boot/simpleboot-yosemite.c
> --- linux-2.6.28.orig/arch/powerpc/boot/simpleboot-yosemite.c   1969-12-31
> 17:00:00.000000000 -0700
> +++ linux-2.6.28/arch/powerpc/boot/simpleboot-yosemite.c        2009-03-06
> 15:33:24.000000000 -0700
> @@ -0,0 +1,23 @@
> +#include "ops.h"
> +#include "stdio.h"
> +#include "4xx.h"
> +#include "44x.h"
> +
> +#define TARGET_4xx
> +#define TARGET_44x
> +#include "ppcboot.h"
> +
> +static void yosemite_fixups(void)
> +{
> +       unsigned long sysclk = 66666666;
> +
> +       ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
> +       ibm4xx_sdram_fixup_memsize();
> +}
> +
> +void platform_specific_init(void)
> +{
> +       platform_ops.fixups = yosemite_fixups;
> +       platform_ops.exit = ibm44x_dbcr_reset;
> +}
>
>> diff -urN linux-2.6.28.orig/arch/powerpc/boot/simpleboot-yosemite.c
>> linux-2.6.28/arch/powerpc/boot/simpleboot-yosemite.c
>> --- linux-2.6.28.orig/arch/powerpc/boot/simpleboot-yosemite.c   1969-12-31
>> 17:00:00.000000000 -0700
>> +++ linux-2.6.28/arch/powerpc/boot/simpleboot-yosemite.c        2009-03-06
>> 14:55:46.000000000 -0700
>> @@ -0,0 +1,24 @@
>> +#include "ops.h"
>> +#include "stdio.h"
>> +#include "4xx.h"
>> +#include "44x.h"
>> +
>> +#define TARGET_4xx
>> +#define TARGET_44x
>> +#include "ppcboot.h"
>> +
>> +static void yosemite_fixups(void)
>> +{
>> +       unsigned long sysclk = 50000000;
>> +
>> +       ibm440ep_fixup_clocks(sysclk, 11059200, 400000000);
>> +       ibm4xx_sdram_fixup_memsize();
>> +       dt_fixup_mac_address_by_alias("ethernet0", eth0adr);
>> +       dt_fixup_mac_address_by_alias("ethernet1", eth1adr);
>> +}
>> +
>> +void platform_specific_init(void)
>> +{
>> +       platform_ops.fixups = yosemite_fixups;
>> +       platform_ops.exit = ibm44x_dbcr_reset;
>> +}
>>
>
>
> --
> Best Regards,
> ________________________________________________________________
>  Eddie Dawydiuk, Technologic Systems | voice:  (480) 837-5200
>  16525 East Laser Drive              | fax:    (480) 837-5300
>  Fountain Hills, AZ 85268            | web: www.embeddedARM.com
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
Grant Likely March 7, 2009, 5:41 a.m. UTC | #3
On Fri, Mar 6, 2009 at 9:22 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Fri, Mar 6, 2009 at 3:32 PM, Eddie Dawydiuk <eddie@embeddedarm.com> wrote:
>> Hello,
>>
>> Let's try this one more time. The last patch was using the clocks for a
>> custom board based on the Yosemite board and was referencing a non-existent
>> ethNadr( I forgot to pull out this code out).
>
> But the question remains: Why do you need simpleboot support for
> Yosemite when you can use a uImage or cuImage with u-boot?

On a more general note; this patch also diverges from the original
model for simple image.  The idea behind simpleimage was that it would
contain a fully formed device tree, with no fixups necessary.  I want
to think carefully before diverging from that.

Cheers,
g.
Eddie Dawydiuk March 7, 2009, 3:14 p.m. UTC | #4
Hello,

> But the question remains: Why do you need simpleboot support for
> Yosemite when you can use a uImage or cuImage with u-boot?

We are developing a new board based upon the Yosemite board. Seeing as
though the Yosemite board was supported in the mainline kernel I decided
to start with that code base. After looking at what different
options/images were available for device trees vs open firmware I decided
the simpleImage would be the ideal format for our new board. I then read
how to build a simpleImage for the Yosemite board, which build without any
compiler errors. Although I found the image didn't work, so I figured it
might be helpful for others if the image just worked without
modifications. Although shortly I will be submitting support for our
custom board using this same approach. So if you have any suggestions on
this approach using the simpleImage please let me know.

On another note, can you tell me/point me to some documentation on how to
get a unique machine ID for a new board?

--
Best Regards,
Eddie Dawydiuk March 7, 2009, 3:21 p.m. UTC | #5
Hello,

> On a more general note; this patch also diverges from the original
> model for simple image.  The idea behind simpleimage was that it would
> contain a fully formed device tree, with no fixups necessary.  I want
> to think carefully before diverging from that.

I wasn't aware of these design goals... I believe one can also modify the
default dts file such that the RAM size is not dynamically detected so the
fixups aren't required(although keep in mind I haven't tested this).
Although it is quite convenient to add the fixed-head.o so one can jump
into the simpleImage at offset 0 rather than having to check what the
offset should be each time a change is made.

//Eddie
Grant Likely March 7, 2009, 4:04 p.m. UTC | #6
On Sat, Mar 7, 2009 at 8:21 AM, Eddie Dawydiuk <eddie@embeddedarm.com> wrote:
> Hello,
>
>> On a more general note; this patch also diverges from the original
>> model for simple image.  The idea behind simpleimage was that it would
>> contain a fully formed device tree, with no fixups necessary.  I want
>> to think carefully before diverging from that.
>
> I wasn't aware of these design goals... I believe one can also modify the
> default dts file such that the RAM size is not dynamically detected so the
> fixups aren't required(although keep in mind I haven't tested this).

Just to be clear, I'm not saying 'no'.  I'm just not saying 'yes' yet
either.  However, if you can fully form the dts file then that is
definitely my preference.

> Although it is quite convenient to add the fixed-head.o so one can jump
> into the simpleImage at offset 0 rather than having to check what the
> offset should be each time a change is made.

The missing fixed-head thing is a bug.  I have no issue with that change.

g.
Grant Likely March 7, 2009, 4:06 p.m. UTC | #7
On Sat, Mar 7, 2009 at 8:14 AM, Eddie Dawydiuk <eddie@embeddedarm.com> wrote:
> Hello,
>
>> But the question remains: Why do you need simpleboot support for
>> Yosemite when you can use a uImage or cuImage with u-boot?
>
> We are developing a new board based upon the Yosemite board. Seeing as
> though the Yosemite board was supported in the mainline kernel I decided
> to start with that code base. After looking at what different
> options/images were available for device trees vs open firmware I decided
> the simpleImage would be the ideal format for our new board. I then read
> how to build a simpleImage for the Yosemite board, which build without any
> compiler errors. Although I found the image didn't work, so I figured it
> might be helpful for others if the image just worked without
> modifications. Although shortly I will be submitting support for our
> custom board using this same approach. So if you have any suggestions on
> this approach using the simpleImage please let me know.

Before I answer this, what bootloader are you using?

> On another note, can you tell me/point me to some documentation on how to
> get a unique machine ID for a new board?

What do you mean?  Are you referring to the top level compatible and
model properties?

g.
Sean MacLennan March 8, 2009, 7:20 p.m. UTC | #8
On Sat, 7 Mar 2009 08:14:41 -0700 (MST)
"Eddie Dawydiuk" <eddie@embeddedarm.com> wrote:

> On another note, can you tell me/point me to some documentation on
> how to get a unique machine ID for a new board?

Do you mean the model in the dts, like "amcc,yosemite"? You just pick
one.

It is just company name, board name. We based the Pika Warp on the
yosemite board but our model name is pika,warp since it is too far
removed to use the stock yosemite to use the same DTS.

Cheers,
   Sean
diff mbox

Patch

diff -urN linux-2.6.28.orig/arch/powerpc/boot/wrapper 
linux-2.6.28/arch/powerpc/boot/wrapper
--- linux-2.6.28.orig/arch/powerpc/boot/wrapper 2008-12-24 16:26:37.000000000 -0700
+++ linux-2.6.28/arch/powerpc/boot/wrapper      2009-03-05 17:36:10.000000000 -0700
@@ -214,8 +214,12 @@ 
      platformo="$object/simpleboot.o $object/virtex.o"
      binary=y
      ;;
+simpleboot-yosemite)
+    platformo="$object/fixed-head.o $object/simpleboot.o 
$object/simpleboot-yosemite.o"
+    binary=y
+    ;;
  simpleboot-*)
-    platformo="$object/simpleboot.o"
+    platformo="$object/fixed-head.o $object/simpleboot.o"
      binary=y
      ;;