Skip to contentSkip to conversation

MIPS: Netlogic: modular build fixes

PATCH In review Florian Fainelli 2 participants 5 messages Sep 24, 2014 – Sep 25, 2014 MIPS

lore
Share & tools
lore
#0 lore raw

cover MIPS: Netlogic: modular build fixes

Hello Ralf, Jayachandran, Ganesan

Here are two small fixes for modular USB and AHCI builds that I encountered while playing with a FVP board.

These are based off upstream-sfr/mips-for-linux-next

Thanks!

Florian Fainelli (2):
MIPS: Netlogic: handle modular USB case
MIPS: Netlogic: handle modular AHCI builds

 arch/mips/netlogic/xlp/Makefile | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 MIPS: Netlogic: handle modular USB case

Commit 1004165f346a ("MIPS: Netlogic: USB support for XLP") and then commit 9eac3591e78b ("MIPS: Netlogic: Add support for USB on XLP2xx") added usb-init and usb-init-xlp2 as objects to build when CONFIG_USB is enabled.

If CONFIG_USB is made modular, these two files will also get built as modules (obj-m), which will result in the following linking failure:

ERROR: "nlm_io_base" [arch/mips/netlogic/xlp/usb-init.ko] undefined!
ERROR: "nlm_nodes" [arch/mips/netlogic/xlp/usb-init-xlp2.ko] undefined!
ERROR: "nlm_set_pic_extra_ack" [arch/mips/netlogic/xlp/usb-init-xlp2.ko] undefined!
ERROR: "xlp_socdev_to_node" [arch/mips/netlogic/xlp/usb-init-xlp2.ko] undefined!
ERROR: "nlm_io_base" [arch/mips/netlogic/xlp/usb-init-xlp2.ko] undefined!

Just check whether CONFIG_USB is defined for this build, and if that is the case, add these objects to the list of built-in object files.

---
 arch/mips/netlogic/xlp/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/mips/netlogic/xlp/Makefile +4 -2
index be358a8050c5..577889f7275e 100644
@@ -1,6 +1,8 @@
 obj-y				+= setup.o nlm_hal.o cop2-ex.o dt.o
 obj-$(CONFIG_SMP)		+= wakeup.o
-obj-$(CONFIG_USB)		+= usb-init.o
-obj-$(CONFIG_USB)		+= usb-init-xlp2.o
+ifdef CONFIG_USB
+obj-y				+= usb-init.o
+obj-y				+= usb-init-xlp2.o
+endif
 obj-$(CONFIG_SATA_AHCI)		+= ahci-init.o
 obj-$(CONFIG_SATA_AHCI)		+= ahci-init-xlp2.o
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/2 MIPS: Netlogic: handle modular AHCI builds

In reply to Florian Fainelli

Commits a951440971d0 ("MIPS: Netlogic: Support for XLP3XX on-chip SATA") and fedfcb1137d2 ("MIPS: Netlogic: XLP9XX on-chip SATA support") added ahci-init and ahci-init-xlp2 as objects to build when CONFIG_SATA_AHCI is enabled.

If CONFIG_SATA_AHCI is made modular, these two files will also get built as modules (obj-m), which will result in the following linking failure:

ERROR: "nlm_set_pic_extra_ack" [arch/mips/netlogic/xlp/ahci-init.ko] undefined!
ERROR: "nlm_io_base" [arch/mips/netlogic/xlp/ahci-init.ko] undefined!
ERROR: "nlm_nodes" [arch/mips/netlogic/xlp/ahci-init-xlp2.ko] undefined!
ERROR: "nlm_set_pic_extra_ack" [arch/mips/netlogic/xlp/ahci-init-xlp2.ko] undefined!
ERROR: "xlp_socdev_to_node" [arch/mips/netlogic/xlp/ahci-init-xlp2.ko] undefined!
ERROR: "nlm_io_base" [arch/mips/netlogic/xlp/ahci-init-xlp2.ko] undefined!

Just check whether CONFIG_SATA_AHCI is defined for this build, and if that is the case, add these objects to the list of built-in object files.

---
 arch/mips/netlogic/xlp/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/mips/netlogic/xlp/Makefile +4 -2
index 577889f7275e..6b43af0a34d9 100644
@@ -4,5 +4,7 @@ ifdef CONFIG_USB
 obj-y				+= usb-init.o
 obj-y				+= usb-init-xlp2.o
 endif
-obj-$(CONFIG_SATA_AHCI)		+= ahci-init.o
-obj-$(CONFIG_SATA_AHCI)		+= ahci-init-xlp2.o
+ifdef CONFIG_SATA_AHCI
+obj-y				+= ahci-init.o
+obj-y				+= ahci-init-xlp2.o
+endif
Signature · 1 line
1.9.1
#3 lore raw
In reply to Florian Fainelli
Quoted 6 lines · Florian Fainelli

Hello Ralf, Jayachandran, Ganesan

Here are two small fixes for modular USB and AHCI builds that I encountered while playing with a FVP board.

These are based off upstream-sfr/mips-for-linux-next

We have a slightly different fix for this in our internal repository, I was planning to submit it soon:

index be358a8..5c876d3 100644

arch/mips/netlogic/xlp/Makefile +4 -4
@@ -1,6 +1,6 @@
 obj-y				+= setup.o nlm_hal.o cop2-ex.o dt.o
 obj-$(CONFIG_SMP)		+= wakeup.o
-obj-$(CONFIG_USB)		+= usb-init.o
-obj-$(CONFIG_USB)		+= usb-init-xlp2.o
-obj-$(CONFIG_SATA_AHCI)		+= ahci-init.o
-obj-$(CONFIG_SATA_AHCI)		+= ahci-init-xlp2.o
+obj-$(subst m,y,$(CONFIG_USB))	+= usb-init.o
+obj-$(subst m,y,$(CONFIG_USB))	+= usb-init-xlp2.o
+obj-$(subst m,y,$(CONFIG_SATA_AHCI))	+= ahci-init.o
+obj-$(subst m,y,$(CONFIG_SATA_AHCI))	+= ahci-init-xlp2.o

This will add the init code when USB or SATA is enabled as module or is built-in, so I think this is be a better solution.

JC.

#4 lore raw
Quoted 27 lines · Jayachandran C.
Quoted 6 lines · Florian Fainelli

Hello Ralf, Jayachandran, Ganesan

Here are two small fixes for modular USB and AHCI builds that I encountered while playing with a FVP board.

These are based off upstream-sfr/mips-for-linux-next

We have a slightly different fix for this in our internal repository, I was planning to submit it soon:

index be358a8..5c876d3 100644

arch/mips/netlogic/xlp/Makefile +4 -4
@@ -1,6 +1,6 @@
 obj-y				+= setup.o nlm_hal.o cop2-ex.o dt.o
 obj-$(CONFIG_SMP)		+= wakeup.o
-obj-$(CONFIG_USB)		+= usb-init.o
-obj-$(CONFIG_USB)		+= usb-init-xlp2.o
-obj-$(CONFIG_SATA_AHCI)		+= ahci-init.o
-obj-$(CONFIG_SATA_AHCI)		+= ahci-init-xlp2.o
+obj-$(subst m,y,$(CONFIG_USB))	+= usb-init.o
+obj-$(subst m,y,$(CONFIG_USB))	+= usb-init-xlp2.o
+obj-$(subst m,y,$(CONFIG_SATA_AHCI))	+= ahci-init.o
+obj-$(subst m,y,$(CONFIG_SATA_AHCI))	+= ahci-init-xlp2.o
Quoted 2 lines

This will add the init code when USB or SATA is enabled as module or is built-in, so I think this is be a better solution.

Not sure which one is "better" than the other since they both solve the same problem, but whatever works for you also works for me! The tree seems to have a mix of both approaches.

Thanks!
--
Florian