All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC: machine customized ixp4xx NPE firmware
@ 2007-05-15 11:22 Robin Farine
  2007-05-15 18:38 ` Leon Woestenberg
  2007-05-16  1:24 ` Rod Whitby
  0 siblings, 2 replies; 7+ messages in thread
From: Robin Farine @ 2007-05-15 11:22 UTC (permalink / raw)
  To: openembedded-devel

Hello everyone,

The platform I am working on is using NPE-B and NPE-C as Ethernet
interfaces. The ixp4xx-npe package from the OE snapshot I am 
currently
using builds firmware for NPE-B only and the firmware type is 
hard-coded
in "IxNpeMicrocode.h".

The patch below proposes a means of letting the machine 
configuration file
decide which NPE firmware to build.

Another but somewhat related point is the COMPATIBLE_MACHINE 
variable. If
my machine's name does not start with nslug or ixp4xx, I am forced 
to
change many package recipes (I suspect it is a FAQ but I do not seem 
to
able to access the mailing-list archive at the moment), perhaps a
COMPATIBLE_ARCH variable would be help here ?

Thanks,

Robin

diff --git 
a/packages/ixp4xx/ixp4xx-npe-native-2.3.2/IxNpeMicrocode.h 
b/packages/ixp4xx/ixp4xx-npe-native-2.3.2/IxNpeMicrocode.h
--- a/packages/ixp4xx/ixp4xx-npe-native-2.3.2/IxNpeMicrocode.h
+++ b/packages/ixp4xx/ixp4xx-npe-native-2.3.2/IxNpeMicrocode.h
@@ -42,7 +42,7 @@
 // #define IX_NPEDL_NPEIMAGE_NPEB_DMA
 // #define 
IX_NPEDL_NPEIMAGE_NPEB_ETH_SPAN_FIREWALL_VLAN_QOS_HDR_CONV
 // #define 
IX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_FIREWALL_VLAN_QOS
-#define IX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_FIREWALL
+// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_FIREWALL
 
 
 // #define 
IX_NPEDL_NPEIMAGE_NPEC_ETH_SPAN_MASK_FIREWALL_VLAN_QOS_HDR_CONV_EXTMIB
@@ -51,7 +51,7 @@
 // #define IX_NPEDL_NPEIMAGE_NPEC_DMA
 // #define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_ETH_LEARN_FILTER_SPAN
 // #define 
IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_ETH_LEARN_FILTER_FIREWALL
-#define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_CCM_ETH
+// #define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_CCM_ETH
 // #define 
IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_ETH_LEARN_FILTER_SPAN_FIREWALL
 // #define 
IX_NPEDL_NPEIMAGE_NPEC_ETH_SPAN_FIREWALL_VLAN_QOS_HDR_CONV
 // #define 
IX_NPEDL_NPEIMAGE_NPEC_ETH_LEARN_FILTER_SPAN_FIREWALL_VLAN_QOS
diff --git a/packages/ixp4xx/ixp4xx-npe-native_2.3.2.bb 
b/packages/ixp4xx/ixp4xx-npe-native_2.3.2.bb
--- a/packages/ixp4xx/ixp4xx-npe-native_2.3.2.bb
+++ b/packages/ixp4xx/ixp4xx-npe-native_2.3.2.bb
@@ -7,9 +7,14 @@ inherit native
 inherit native
 S = "${WORKDIR}/ixp400_xscale_sw/src/npeDl"
 
+# A space-separated list of CPP defines that select the firmware 
images
+# to build for the target machine.
+IXP4XX_NPE_FIRWMARE_DEFINES ?= "\
+-DIX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_FIREWALL"
+
 do_compile() {
 	mv ${WORKDIR}/IxNpeMicrocode.h ${S}/
-	gcc -Wall IxNpeMicrocode.c -o IxNpeMicrocode
+	gcc -Wall ${IXP4XX_NPE_FIRWMARE_DEFINES} IxNpeMicrocode.c -o 
IxNpeMicrocode
 }
 
 do_stage() {
diff --git a/packages/ixp4xx/ixp4xx-npe_2.3.2.bb 
b/packages/ixp4xx/ixp4xx-npe_2.3.2.bb
--- a/packages/ixp4xx/ixp4xx-npe_2.3.2.bb
+++ b/packages/ixp4xx/ixp4xx-npe_2.3.2.bb
@@ -13,7 +13,7 @@ S = "${WORKDIR}/ixp400_xscale_sw/src/npe
 
 COMPATIBLE_MACHINE = "(nslu2|ixp4xx)"
 
-FILES_${PN} = "${base_libdir}/firmware/NPE-B"
+FILES_${PN} = "${base_libdir}/firmware/NPE-*"
 
 do_compile() {
 	${STAGING_BINDIR_NATIVE}/IxNpeMicrocode-${PV} -be
@@ -21,13 +21,20 @@ do_compile() {
 
 do_install() {
 	install -d ${D}/${base_libdir}/firmware/
-	rm ${S}/NPE-B
-	mv ${S}/NPE-B.* ${S}/NPE-B
-	install ${S}/NPE-B ${D}/${base_libdir}/firmware/
+	for npe in A B C; do
+		rm ${S}/NPE-${npe} 2>/dev/null || true
+		mv ${S}/NPE-${npe}.* ${S}/NPE-${npe} 2>/dev/null || true
+		if test -f ${S}/NPE-${npe}; then
+			install -m 644 ${S}/NPE-${npe} ${D}/${base_libdir}/firmware/
+		fi
+	done
 }
 
 do_populate_staging() {
 	install -d ${STAGING_FIRMWARE_DIR}
-	install ${S}/NPE-B ${STAGING_FIRMWARE_DIR}/
+	for npe in A B C; do
+		if test -f ${S}/NPE-${npe}; then
+			install -m 644 ${S}/NPE-${npe} ${STAGING_FIRMWARE_DIR}/
+		fi
+	done
 }
-




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: machine customized ixp4xx NPE firmware
  2007-05-15 11:22 Robin Farine
@ 2007-05-15 18:38 ` Leon Woestenberg
  2007-05-15 20:17   ` Robin Farine
  2007-05-16  1:24 ` Rod Whitby
  1 sibling, 1 reply; 7+ messages in thread
From: Leon Woestenberg @ 2007-05-15 18:38 UTC (permalink / raw)
  To: openembedded-devel

Hello Robin,

On 5/15/07, Robin Farine <robin.farine@terminus.org> wrote:
> +IXP4XX_NPE_FIRWMARE_DEFINES ?= "\
> +-DIX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_FIREWALL"
> +
>  do_compile() {
>         mv ${WORKDIR}/IxNpeMicrocode.h ${S}/
> -       gcc -Wall IxNpeMicrocode.c -o IxNpeMicrocode
> +       gcc -Wall ${IXP4XX_NPE_FIRWMARE_DEFINES} IxNpeMicrocode.c -o
>
Please change IXP4XX_NPE_FIRWMARE_DEFINES into IXP4X
IX_NPE_FIRMWARE_DEFINES.

The idea looks ok.

Regards,

Leon.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: machine customized ixp4xx NPE firmware
  2007-05-15 18:38 ` Leon Woestenberg
@ 2007-05-15 20:17   ` Robin Farine
  0 siblings, 0 replies; 7+ messages in thread
From: Robin Farine @ 2007-05-15 20:17 UTC (permalink / raw)
  To: openembedded-devel

On Tuesday May 15 2007 20:38, Leon Woestenberg wrote:
> On 5/15/07, Robin Farine <robin.farine@terminus.org> wrote:
> > +IXP4XX_NPE_FIRWMARE_DEFINES ?= "\
> > +-DIX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_FIREWALL"
> > +
> >  do_compile() {
> >         mv ${WORKDIR}/IxNpeMicrocode.h ${S}/
> > -       gcc -Wall IxNpeMicrocode.c -o IxNpeMicrocode
> > +       gcc -Wall ${IXP4XX_NPE_FIRWMARE_DEFINES}
> > IxNpeMicrocode.c -o
>
> Please change IXP4XX_NPE_FIRWMARE_DEFINES into IXP4X
> IX_NPE_FIRMWARE_DEFINES.

Ah, you mean s/FIRWMARE/FIRMWARE/, yes, makes sense :-). I'll fix 
this and submit the patch to the bug tracker.

> The idea looks ok.

Thanks for reviewing it.

Regards,

Robin



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: machine customized ixp4xx NPE firmware
  2007-05-15 11:22 Robin Farine
  2007-05-15 18:38 ` Leon Woestenberg
@ 2007-05-16  1:24 ` Rod Whitby
  2007-05-16  8:56   ` Robin Farine
  2007-05-16 10:44   ` Richard Purdie
  1 sibling, 2 replies; 7+ messages in thread
From: Rod Whitby @ 2007-05-16  1:24 UTC (permalink / raw)
  To: openembedded-devel

Robin Farine wrote:
> The platform I am working on is using NPE-B and NPE-C as Ethernet
> interfaces. The ixp4xx-npe package from the OE snapshot I am 
> currently
> using builds firmware for NPE-B only and the firmware type is 
> hard-coded
> in "IxNpeMicrocode.h".
> 
> The patch below proposes a means of letting the machine 
> configuration file
> decide which NPE firmware to build.

Thanks.  We'll be very happy to apply that patch.  I'll take a close
look at it tonight.

> Another but somewhat related point is the COMPATIBLE_MACHINE 
> variable. If
> my machine's name does not start with nslug or ixp4xx, I am forced 
> to
> change many package recipes (I suspect it is a FAQ but I do not seem 
> to
> able to access the mailing-list archive at the moment), perhaps a
> COMPATIBLE_ARCH variable would be help here ?

Which machine/arch are you using?  We can easily extend that
compatibility to include any other machines/archs that will use it.

-- Rod



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: machine customized ixp4xx NPE firmware
  2007-05-16  1:24 ` Rod Whitby
@ 2007-05-16  8:56   ` Robin Farine
  2007-05-16 10:44   ` Richard Purdie
  1 sibling, 0 replies; 7+ messages in thread
From: Robin Farine @ 2007-05-16  8:56 UTC (permalink / raw)
  To: openembedded-devel

On Wed May 16 2007 03:24, Rod Whitby wrote:
> Robin Farine wrote:

> > The patch below proposes a means of letting the machine
> > configuration file
> > decide which NPE firmware to build.
>
> Thanks.  We'll be very happy to apply that patch.  I'll take a
> close look at it tonight.

I forgot to disable line wrapping when I reposted it to the correct 
mailing-list... You may prefer to have a look at the cleaner 
version in bugzilla.

> Which machine/arch are you using?  We can easily extend that
> compatibility to include any other machines/archs that will use
> it.

Its a custom ixp425 big-endian board of which 2 functional exemplars 
currently exist :-). Not a problem, I just wondered whether 
something like COMPATIBLE_ARCH exists.

Robin



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: machine customized ixp4xx NPE firmware
  2007-05-16  1:24 ` Rod Whitby
  2007-05-16  8:56   ` Robin Farine
@ 2007-05-16 10:44   ` Richard Purdie
  1 sibling, 0 replies; 7+ messages in thread
From: Richard Purdie @ 2007-05-16 10:44 UTC (permalink / raw)
  To: openembedded-devel

On Wed, 2007-05-16 at 10:54 +0930, Rod Whitby wrote:
> Robin Farine wrote:
> > Another but somewhat related point is the COMPATIBLE_MACHINE 
> > variable. If
> > my machine's name does not start with nslug or ixp4xx, I am forced 
> > to
> > change many package recipes (I suspect it is a FAQ but I do not seem 
> > to
> > able to access the mailing-list archive at the moment), perhaps a
> > COMPATIBLE_ARCH variable would be help here ?
> 
> Which machine/arch are you using?  We can easily extend that
> compatibility to include any other machines/archs that will use it.

A neat way to handle this might be to define:

IXPMACHINES = "nslu2|ixp4xx|whatever"

and then the ixp specific .bb's check IXPMACHINES rather than a specific
list. The list would then be maintained in one place and is easily
updated if anyone adds a new ixp like machine.

I've not looked at the specifics, its just a random idea I had...

Cheers,

Richard







^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: RFC: machine customized ixp4xx NPE firmware
@ 2007-05-16 14:32 Mark Gollahon
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Gollahon @ 2007-05-16 14:32 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]

Richard Purdie wrote ..
> 
> A neat way to handle this might be to define:
> 
> IXPMACHINES = "nslu2|ixp4xx|whatever"
> 
> and then the ixp specific .bb's check IXPMACHINES rather than a specific
> list. The list would then be maintained in one place and is easily
> updated if anyone adds a new ixp like machine.
> 
> I've not looked at the specifics, its just a random idea I had...
> 
> Cheers,
> 
> Richard

I want to second this approach as I tried awhile back to build OE for an IXP4XX-based machine that came into my possession and, during that time, ended up patching several IXP-specific .bb's to add my new machine.  My work would have been much easier had IXPMACHINES existed.

(NOTE: I did get it almost completely working, the only problem ended up being the networking ports didn't work, which, for a firewall machine, meant the device was useless.  There is an IC175 switch chip sitting between the IXP's two network ports and the physical ports and I couldn't figure out how to hack the IXP net driver to get the IC175 to pass eth frames.)

Regards,
-Mark Gollahon

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-05-16 14:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-16 14:32 RFC: machine customized ixp4xx NPE firmware Mark Gollahon
  -- strict thread matches above, loose matches on Subject: below --
2007-05-15 11:22 Robin Farine
2007-05-15 18:38 ` Leon Woestenberg
2007-05-15 20:17   ` Robin Farine
2007-05-16  1:24 ` Rod Whitby
2007-05-16  8:56   ` Robin Farine
2007-05-16 10:44   ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.