Skip to contentSkip to conversation

MPC8xxx: Define cache ops for USB

PATCH Superseded Marek Vasut 5 participants 8 messages May 25, 2012 – Jun 7, 2012 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MPC8xxx: Define cache ops for USB

This patch conditionally defines flush_dcache_range() and invalidate_dcache_range() on MPC8xxx, to avoid EHCI complaining, resulting in the following output:

$ ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- ./MAKEALL MPC8572DS
Configuring for MPC8572DS board...
make: *** [u-boot] Error 1
powerpc-linux-gnu-size: './u-boot': No such file
e1000.c: In function ?e1000_initialize?:
e1000.c:5264:13: warning: assignment from incompatible pointer type [enabled by default]
tsec.c: In function ?tsec_initialize?:
tsec.c:638:12: warning: assignment from incompatible pointer type [enabled by default]
drivers/usb/host/libusb_host.o: In function `ehci_td_buffer':
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:186: undefined reference to `flush_dcache_range'
drivers/usb/host/libusb_host.o: In function `ehci_submit_async':
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:346: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:348: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:349: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:372: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:374: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:376: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:386: undefined reference to `invalidate_dcache_range'
make: *** [u-boot] Error 1

--------------------- SUMMARY ---------------------------- Boards compiled: 1
Boards with errors: 1 ( MPC8572DS )
----------------------------------------------------------

Cc Wolfgang Denk <[email protected]>
Cc Anatolij Gustschin <[email protected]>
---
 arch/powerpc/cpu/mpc83xx/Makefile |    3 +++
 arch/powerpc/cpu/mpc83xx/cache.c  |   33 +++++++++++++++++++++++++++++++++
 arch/powerpc/cpu/mpc85xx/Makefile |    3 +++
 arch/powerpc/cpu/mpc85xx/cache.c  |   33 +++++++++++++++++++++++++++++++++
 4 files changed, 72 insertions(+)
 create mode 100644 arch/powerpc/cpu/mpc83xx/cache.c
 create mode 100644 arch/powerpc/cpu/mpc85xx/cache.c
arch/powerpc/cpu/mpc83xx/Makefile +3 -0
index b5c499d..012ab6b 100644
@@ -41,6 +41,9 @@ COBJS-$(CONFIG_PCI) += pci.o
 COBJS-$(CONFIG_PCIE) += pcie.o
 COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
 
+# Stub implementations of cache management functions for USB
+COBJS-$(CONFIG_USB_EHCI) += cache.o
+
 ifdef CONFIG_FSL_DDR2
 COBJS_LN-$(CONFIG_MPC8349) += ddr-gen2.o
 else
arch/powerpc/cpu/mpc83xx/cache.c new file +33 -0
new file mode 100644
index 0000000..2a08b65
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2012 Marek Vasut <[email protected]>
+ *
+ * This file contains stub implementation of
+ *   invalidate_dcache_range()
+ *   flush_dcache_range()
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+void invalidate_dcache_range(unsigned long start, unsigned long stop)
+{
+}
+
+void flush_dcache_range(unsigned long start, unsigned long stop)
+{
+}
arch/powerpc/cpu/mpc85xx/Makefile +3 -0
index 058d609..c512b33 100644
@@ -129,6 +129,9 @@ COBJS	+= speed.o
 COBJS	+= tlb.o
 COBJS	+= traps.o
 
+# Stub implementations of cache management functions for USB
+COBJS-$(CONFIG_USB_EHCI) += cache.o
+
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
 START	:= $(addprefix $(obj),$(START))
arch/powerpc/cpu/mpc85xx/cache.c new file +33 -0
new file mode 100644
index 0000000..2a08b65
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2012 Marek Vasut <[email protected]>
+ *
+ * This file contains stub implementation of
+ *   invalidate_dcache_range()
+ *   flush_dcache_range()
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+void invalidate_dcache_range(unsigned long start, unsigned long stop)
+{
+}
+
+void flush_dcache_range(unsigned long start, unsigned long stop)
+{
+}
Signature · 1 line
1.7.10
#1 lore raw

PATCH v2 1/1 MPC8xxx: Define cache ops for USB

This patch conditionally defines flush_dcache_range() and invalidate_dcache_range() on MPC8xxx, to avoid EHCI complaining, resulting in the following output:

$ ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- ./MAKEALL MPC8572DS
Configuring for MPC8572DS board...
make: *** [u-boot] Error 1
powerpc-linux-gnu-size: './u-boot': No such file
e1000.c: In function ?e1000_initialize?:
e1000.c:5264:13: warning: assignment from incompatible pointer type [enabled by default]
tsec.c: In function ?tsec_initialize?:
tsec.c:638:12: warning: assignment from incompatible pointer type [enabled by default]
drivers/usb/host/libusb_host.o: In function `ehci_td_buffer':
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:186: undefined reference to `flush_dcache_range'
drivers/usb/host/libusb_host.o: In function `ehci_submit_async':
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:346: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:348: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:349: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:372: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:374: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:376: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:386: undefined reference to `invalidate_dcache_range'
make: *** [u-boot] Error 1

--------------------- SUMMARY ---------------------------- Boards compiled: 1
Boards with errors: 1 ( MPC8572DS )
----------------------------------------------------------

Cc Wolfgang Denk <[email protected]>
Cc Anatolij Gustschin <[email protected]>
---
 arch/powerpc/cpu/mpc512x/Makefile |    3 +++
 arch/powerpc/cpu/mpc512x/cache.c  |   33 +++++++++++++++++++++++++++++++++
 arch/powerpc/cpu/mpc83xx/Makefile |    3 +++
 arch/powerpc/cpu/mpc83xx/cache.c  |   33 +++++++++++++++++++++++++++++++++
 arch/powerpc/cpu/mpc85xx/Makefile |    3 +++
 arch/powerpc/cpu/mpc85xx/cache.c  |   33 +++++++++++++++++++++++++++++++++
 6 files changed, 108 insertions(+)
 create mode 100644 arch/powerpc/cpu/mpc512x/cache.c
 create mode 100644 arch/powerpc/cpu/mpc83xx/cache.c
 create mode 100644 arch/powerpc/cpu/mpc85xx/cache.c

V2: Fix MPC512x too

arch/powerpc/cpu/mpc512x/Makefile +3 -0
index 4a4bc0d..b53232f 100644
@@ -41,6 +41,9 @@ COBJS-$(CONFIG_CMD_IDE) += ide.o
 COBJS-$(CONFIG_IIM) += iim.o
 COBJS-$(CONFIG_PCI) += pci.o
 
+# Stub implementations of cache management functions for USB
+COBJS-$(CONFIG_USB_EHCI) += cache.o
+
 COBJS	:= $(COBJS-y)
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
arch/powerpc/cpu/mpc512x/cache.c new file +33 -0
new file mode 100644
index 0000000..2a08b65
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2012 Marek Vasut <[email protected]>
+ *
+ * This file contains stub implementation of
+ *   invalidate_dcache_range()
+ *   flush_dcache_range()
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+void invalidate_dcache_range(unsigned long start, unsigned long stop)
+{
+}
+
+void flush_dcache_range(unsigned long start, unsigned long stop)
+{
+}
arch/powerpc/cpu/mpc83xx/Makefile +3 -0
index b5c499d..012ab6b 100644
@@ -41,6 +41,9 @@ COBJS-$(CONFIG_PCI) += pci.o
 COBJS-$(CONFIG_PCIE) += pcie.o
 COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
 
+# Stub implementations of cache management functions for USB
+COBJS-$(CONFIG_USB_EHCI) += cache.o
+
 ifdef CONFIG_FSL_DDR2
 COBJS_LN-$(CONFIG_MPC8349) += ddr-gen2.o
 else
arch/powerpc/cpu/mpc83xx/cache.c new file +33 -0
new file mode 100644
index 0000000..2a08b65
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2012 Marek Vasut <[email protected]>
+ *
+ * This file contains stub implementation of
+ *   invalidate_dcache_range()
+ *   flush_dcache_range()
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+void invalidate_dcache_range(unsigned long start, unsigned long stop)
+{
+}
+
+void flush_dcache_range(unsigned long start, unsigned long stop)
+{
+}
arch/powerpc/cpu/mpc85xx/Makefile +3 -0
index 058d609..c512b33 100644
@@ -129,6 +129,9 @@ COBJS	+= speed.o
 COBJS	+= tlb.o
 COBJS	+= traps.o
 
+# Stub implementations of cache management functions for USB
+COBJS-$(CONFIG_USB_EHCI) += cache.o
+
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
 START	:= $(addprefix $(obj),$(START))
arch/powerpc/cpu/mpc85xx/cache.c new file +33 -0
new file mode 100644
index 0000000..2a08b65
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2012 Marek Vasut <[email protected]>
+ *
+ * This file contains stub implementation of
+ *   invalidate_dcache_range()
+ *   flush_dcache_range()
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+void invalidate_dcache_range(unsigned long start, unsigned long stop)
+{
+}
+
+void flush_dcache_range(unsigned long start, unsigned long stop)
+{
+}
Signature · 1 line
1.7.10
#2 lore raw

PATCH v2 1/1 MPC8xxx: Define cache ops for USB

Hello Marek,

Quoted 3 lines · Marek Vasut

This patch conditionally defines flush_dcache_range() and invalidate_dcache_range() on MPC8xxx, to avoid EHCI complaining, resulting in the following output:

<snip>

arch/powerpc/cpu/mpc512x/cache.c line 33

Quoted 8 lines
arch/powerpc/cpu/mpc512x/cache.c new file +8 -0
+
+void invalidate_dcache_range(unsigned long start, unsigned long stop)
+{
+}
+
+void flush_dcache_range(unsigned long start, unsigned long stop)
+{
+}

Don't mind if this is a stupid question.
Can't this be placed in some common header?
Just to avoid code duplication!

Thanks,
Vikram

#3 lore raw

PATCH v2 1/1 MPC8xxx: Define cache ops for USB

Quoted 8 lines

Hello Marek,

Quoted 3 lines · Marek Vasut

This patch conditionally defines flush_dcache_range() and invalidate_dcache_range() on MPC8xxx, to avoid EHCI complaining, resulting in the following output:

<snip>

Quoted 12 lines

arch/powerpc/cpu/mpc512x/cache.c line 33

Quoted 8 lines
arch/powerpc/cpu/mpc512x/cache.c new file +8 -0
+
+void invalidate_dcache_range(unsigned long start, unsigned long stop)
+{
+}
+
+void flush_dcache_range(unsigned long start, unsigned long stop)
+{
+}

Don't mind if this is a stupid question.
Can't this be placed in some common header?
Just to avoid code duplication!

And why are they just dummy functions? There are cache flush instructions for ppc

#4 lore raw

PATCH v2 1/1 MPC8xxx: Define cache ops for USB

Dear Joakim Tjernlund,

Quoted 22 lines
Quoted 9 lines

Hello Marek,

Quoted 4 lines · Marek Vasut

This patch conditionally defines flush_dcache_range() and invalidate_dcache_range() on MPC8xxx, to avoid EHCI complaining,

resulting in the following output:

<snip>

Quoted 12 lines

arch/powerpc/cpu/mpc512x/cache.c line 33

Quoted 8 lines
arch/powerpc/cpu/mpc512x/cache.c new file +8 -0
+
+void invalidate_dcache_range(unsigned long start, unsigned long stop)
+{
+}
+
+void flush_dcache_range(unsigned long start, unsigned long stop)
+{
+}

Don't mind if this is a stupid question.
Can't this be placed in some common header?
Just to avoid code duplication!

Quoted 2 lines

And why are they just dummy functions? There are cache flush instructions for ppc

Doesn't the PPC have it's own internal snooping?

Best regards,
Marek Vasut

#5 lore raw

PATCH v2 1/1 MPC8xxx: Define cache ops for USB

In reply to Marek Vasut

Dear Marek Vasut,

Quoted 44 lines · In message <[email protected]> you wrote:

This patch conditionally defines flush_dcache_range() and invalidate_dcache_range() on MPC8xxx, to avoid EHCI complaining, resulting in the following output:

$ ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- ./MAKEALL MPC8572DS
Configuring for MPC8572DS board...
make: *** [u-boot] Error 1
powerpc-linux-gnu-size: './u-boot': No such file
e1000.c: In function ?e1000_initialize?:
e1000.c:5264:13: warning: assignment from incompatible pointer type [enabled by default]
tsec.c: In function ?tsec_initialize?:
tsec.c:638:12: warning: assignment from incompatible pointer type [enabled by default]
drivers/usb/host/libusb_host.o: In function `ehci_td_buffer':
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:186: undefined reference to `flush_dcache_range'
drivers/usb/host/libusb_host.o: In function `ehci_submit_async':
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:346: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:348: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:349: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:372: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:374: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:376: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:386: undefined reference to `invalidate_dcache_range'
make: *** [u-boot] Error 1

--------------------- SUMMARY ---------------------------- Boards compiled: 1
Boards with errors: 1 ( MPC8572DS )
----------------------------------------------------------

Cc Wolfgang Denk <[email protected]>
Cc Anatolij Gustschin <[email protected]>
---
 arch/powerpc/cpu/mpc512x/Makefile |    3 +++
 arch/powerpc/cpu/mpc512x/cache.c  |   33 +++++++++++++++++++++++++++++++++
 arch/powerpc/cpu/mpc83xx/Makefile |    3 +++
 arch/powerpc/cpu/mpc83xx/cache.c  |   33 +++++++++++++++++++++++++++++++++
 arch/powerpc/cpu/mpc85xx/Makefile |    3 +++
 arch/powerpc/cpu/mpc85xx/cache.c  |   33 +++++++++++++++++++++++++++++++++
 6 files changed, 108 insertions(+)
 create mode 100644 arch/powerpc/cpu/mpc512x/cache.c
 create mode 100644 arch/powerpc/cpu/mpc83xx/cache.c
 create mode 100644 arch/powerpc/cpu/mpc85xx/cache.c
Quoted 1 line

V2: Fix MPC512x too

Applied, thanks.

Andy, I hope it is OK with you that I apply this directly.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Bus error -- please leave by the rear door.
#6 lore raw

PATCH 1/1 MPC8xxx: Define cache ops for USB

In reply to Marek Vasut

Dear Marek,

Quoted 7 lines · Marek Vasut
 arch/powerpc/cpu/mpc83xx/Makefile |    3 +++
 arch/powerpc/cpu/mpc83xx/cache.c  |   33 +++++++++++++++++++++++++++++++++
 arch/powerpc/cpu/mpc85xx/Makefile |    3 +++
 arch/powerpc/cpu/mpc85xx/cache.c  |   33 +++++++++++++++++++++++++++++++++
 4 files changed, 72 insertions(+)
 create mode 100644 arch/powerpc/cpu/mpc83xx/cache.c
 create mode 100644 arch/powerpc/cpu/mpc85xx/cache.c

There is a "cache.c" at the path "arch/powerpc/lib", and I think it may be better to put those dummy functions in this file.

And thanks your information about this patch in another mail.

Best Regards,

Liu Gang

#7 lore raw

PATCH 1/1 MPC8xxx: Define cache ops for USB

Dear Liu Gang,

Quoted 12 lines

Dear Marek,

Quoted 8 lines · Marek Vasut
 arch/powerpc/cpu/mpc83xx/Makefile |    3 +++
 arch/powerpc/cpu/mpc83xx/cache.c  |   33
 +++++++++++++++++++++++++++++++++ arch/powerpc/cpu/mpc85xx/Makefile |  
  3 +++
 arch/powerpc/cpu/mpc85xx/cache.c  |   33
 +++++++++++++++++++++++++++++++++ 4 files changed, 72 insertions(+)
 create mode 100644 arch/powerpc/cpu/mpc83xx/cache.c
 create mode 100644 arch/powerpc/cpu/mpc85xx/cache.c
Quoted 4 lines

There is a "cache.c" at the path "arch/powerpc/lib", and I think it may be better to put those dummy functions in this file.

And thanks your information about this patch in another mail.

Honestly, I'm now quite sure about that. As some other PPC CPUs might have different cache management functions implemented? I'll check it though, thanks for the hint, I'm no powerpc expert ;-)

Quoted 4 lines

Best Regards,

Liu Gang

Best regards,
Marek Vasut