mpc83xx: mpc8360emds: Add QE USB device tree fixups
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Wed, 16 Sep 2009 19:22:08 +0000 (23:22 +0400)
committerKim Phillips <kim.phillips@freescale.com>
Fri, 25 Sep 2009 23:25:51 +0000 (18:25 -0500)
With this patch we can change QE USB mode without need to hand-edit
the device tree.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
board/freescale/mpc8360emds/mpc8360emds.c
include/configs/MPC8360EMDS.h

index 54f2989990a10ed759e70b9dd55369d6eba3a159..d4ba043b28372ae2d4e8a16f6a3f2dc16c2dcf24 100644 (file)
@@ -25,6 +25,8 @@
 #if defined(CONFIG_OF_LIBFDT)
 #include <libfdt.h>
 #endif
+#include <hwconfig.h>
+#include <fdt_support.h>
 #if defined(CONFIG_PQ_MDS_PIB)
 #include "../common/pq-mds-pib.h"
 #endif
@@ -357,12 +359,22 @@ static int sdram_init(unsigned int base) { return 0; }
 #endif
 
 #if defined(CONFIG_OF_BOARD_SETUP)
+static void ft_board_fixup_qe_usb(void *blob, bd_t *bd)
+{
+       if (!hwconfig_subarg_cmp("qe_usb", "mode", "peripheral"))
+               return;
+
+       do_fixup_by_compat(blob, "fsl,mpc8323-qe-usb", "mode",
+                          "peripheral", sizeof("peripheral"), 1);
+}
+
 void ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+       ft_board_fixup_qe_usb(blob, bd);
        /*
         * mpc8360ea pb mds errata 2: RGMII timing
         * if on mpc8360ea rev. 2.1,
index fec7cc58551fa4052bdf57d0d7aba94af3a279c0..62cf13be6d15e8a03b47edb4e56700d39ed07248 100644 (file)
 #define CONFIG_NET_MULTI       1
 #endif
 
+#define CONFIG_HWCONFIG                1
+
 /*
  * QE UEC ethernet configuration
  */