[U-Boot] [PATCH 5/8] microblaze: Xilinx BSP to U-Boot conversion matrix
Stephan Linz
linz at li-pro.net
Sun Jan 29 16:54:36 CET 2012
This matrix converts values from the automaticaly generated header
xparameters.h to U-Boot configuration values as needed.
Signed-off-by: Stephan Linz <linz at li-pro.net>
---
board/xilinx/microblaze-generic/xconversions.h | 167 ++++++++++++++++++++++++
include/configs/microblaze-generic.h | 1 +
2 files changed, 168 insertions(+), 0 deletions(-)
create mode 100644 board/xilinx/microblaze-generic/xconversions.h
diff --git a/board/xilinx/microblaze-generic/xconversions.h b/board/xilinx/microblaze-generic/xconversions.h
new file mode 100644
index 0000000..1b94afc
--- /dev/null
+++ b/board/xilinx/microblaze-generic/xconversions.h
@@ -0,0 +1,167 @@
+/*
+ * This is the Xilinx BSP to U-Boot converstion matrix. You have
+ * to include this header immediately after xparameters.h in your
+ * board configuration header. All U-Boot configuration values
+ * have to become constant to avoid unexpected compilation failure.
+ *
+ * (C) Copyright 2012 Li-Pro.Net
+ * Stephan Linz <linz at li-pro.net>
+ *
+ * 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
+ */
+
+#if (XILINX_LLTEMAC_SDMA_USE_DCR == 1)
+# define XILINX_LLTEMAC_SDMA_BUSMODE LL_TEMAC_M_SDMA_DCR
+#else
+# define XILINX_LLTEMAC_SDMA_BUSMODE LL_TEMAC_M_SDMA_PLB
+#endif
+
+/* default parameters for the 1st LLTEMAC */
+#if defined(XILINX_LLTEMAC_BASEADDR)
+# define CONFIG_PHY_ADDR -1
+# define CONFIG_XILINX_LL_TEMAC0_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC0_MII_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC0_BASE_ADDR XILINX_LLTEMAC_BASEADDR
+# if defined(XILINX_LLTEMAC_FIFO_BASEADDR)
+# define CONFIG_XILINX_LL_TEMAC0_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR
+# define CONFIG_XILINX_LL_TEMAC0_CTRL_MODE LL_TEMAC_M_FIFO
+# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR)
+# define CONFIG_XILINX_LL_TEMAC0_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR
+# define CONFIG_XILINX_LL_TEMAC0_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE
+# else
+# error "missing sub-controller base address for LLTEMAC0"
+# endif
+#endif
+
+/* default parameters for the 2nd LLTEMAC */
+#if defined(XILINX_LLTEMAC_BASEADDR1)
+# define CONFIG_PHY1_ADDR -1
+# define CONFIG_XILINX_LL_TEMAC1_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC1_MII_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC1_BASE_ADDR XILINX_LLTEMAC_BASEADDR1
+# if defined(XILINX_LLTEMAC_FIFO_BASEADDR1)
+# define CONFIG_XILINX_LL_TEMAC1_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR1
+# define CONFIG_XILINX_LL_TEMAC1_CTRL_MODE LL_TEMAC_M_FIFO
+# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1)
+# define CONFIG_XILINX_LL_TEMAC1_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1
+# define CONFIG_XILINX_LL_TEMAC1_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE
+# else
+# error "missing sub-controller base address for LLTEMAC1"
+# endif
+#endif
+
+/* default parameters for the 3rd LLTEMAC */
+#if defined(XILINX_LLTEMAC_BASEADDR2)
+# define CONFIG_PHY2_ADDR -1
+# define CONFIG_XILINX_LL_TEMAC2_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC2_MII_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC2_BASE_ADDR XILINX_LLTEMAC_BASEADDR2
+# if defined(XILINX_LLTEMAC_FIFO_BASEADDR2)
+# define CONFIG_XILINX_LL_TEMAC2_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR2
+# define CONFIG_XILINX_LL_TEMAC2_CTRL_MODE LL_TEMAC_M_FIFO
+# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR2)
+# define CONFIG_XILINX_LL_TEMAC2_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR2
+# define CONFIG_XILINX_LL_TEMAC2_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE
+# else
+# error "missing sub-controller base address for LLTEMAC2"
+# endif
+#endif
+
+/* default parameters for the 4th LLTEMAC */
+#if defined(XILINX_LLTEMAC_BASEADDR3)
+# define CONFIG_PHY3_ADDR -1
+# define CONFIG_XILINX_LL_TEMAC3_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC3_MII_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC3_BASE_ADDR XILINX_LLTEMAC_BASEADDR3
+# if defined(XILINX_LLTEMAC_FIFO_BASEADDR3)
+# define CONFIG_XILINX_LL_TEMAC3_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR3
+# define CONFIG_XILINX_LL_TEMAC3_CTRL_MODE LL_TEMAC_M_FIFO
+# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR3)
+# define CONFIG_XILINX_LL_TEMAC3_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR3
+# define CONFIG_XILINX_LL_TEMAC3_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE
+# else
+# error "missing sub-controller base address for LLTEMAC3"
+# endif
+#endif
+
+/* default parameters for the 5th LLTEMAC */
+#if defined(XILINX_LLTEMAC_BASEADDR4)
+# define CONFIG_PHY4_ADDR -1
+# define CONFIG_XILINX_LL_TEMAC4_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC4_MII_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC4_BASE_ADDR XILINX_LLTEMAC_BASEADDR4
+# if defined(XILINX_LLTEMAC_FIFO_BASEADDR4)
+# define CONFIG_XILINX_LL_TEMAC4_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR4
+# define CONFIG_XILINX_LL_TEMAC4_CTRL_MODE LL_TEMAC_M_FIFO
+# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR4)
+# define CONFIG_XILINX_LL_TEMAC4_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR4
+# define CONFIG_XILINX_LL_TEMAC4_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE
+# else
+# error "missing sub-controller base address for LLTEMAC4"
+# endif
+#endif
+
+/* default parameters for the 6th LLTEMAC */
+#if defined(XILINX_LLTEMAC_BASEADDR5)
+# define CONFIG_PHY5_ADDR -1
+# define CONFIG_XILINX_LL_TEMAC5_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC5_MII_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC5_BASE_ADDR XILINX_LLTEMAC_BASEADDR5
+# if defined(XILINX_LLTEMAC_FIFO_BASEADDR5)
+# define CONFIG_XILINX_LL_TEMAC5_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR5
+# define CONFIG_XILINX_LL_TEMAC5_CTRL_MODE LL_TEMAC_M_FIFO
+# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR5)
+# define CONFIG_XILINX_LL_TEMAC5_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR5
+# define CONFIG_XILINX_LL_TEMAC5_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE
+# else
+# error "missing sub-controller base address for LLTEMAC5"
+# endif
+#endif
+
+/* default parameters for the 7th LLTEMAC */
+#if defined(XILINX_LLTEMAC_BASEADDR6)
+# define CONFIG_PHY6_ADDR -1
+# define CONFIG_XILINX_LL_TEMAC6_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC6_MII_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC6_BASE_ADDR XILINX_LLTEMAC_BASEADDR6
+# if defined(XILINX_LLTEMAC_FIFO_BASEADDR6)
+# define CONFIG_XILINX_LL_TEMAC6_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR6
+# define CONFIG_XILINX_LL_TEMAC6_CTRL_MODE LL_TEMAC_M_FIFO
+# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR6)
+# define CONFIG_XILINX_LL_TEMAC6_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR6
+# define CONFIG_XILINX_LL_TEMAC6_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE
+# else
+# error "missing sub-controller base address for LLTEMAC6"
+# endif
+#endif
+
+/* default parameters for the 8th LLTEMAC */
+#if defined(XILINX_LLTEMAC_BASEADDR7)
+# define CONFIG_PHY7_ADDR -1
+# define CONFIG_XILINX_LL_TEMAC7_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC7_MII_NAME NULL
+# define CONFIG_XILINX_LL_TEMAC7_BASE_ADDR XILINX_LLTEMAC_BASEADDR7
+# if defined(XILINX_LLTEMAC_FIFO_BASEADDR7)
+# define CONFIG_XILINX_LL_TEMAC7_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR7
+# define CONFIG_XILINX_LL_TEMAC7_CTRL_MODE LL_TEMAC_M_FIFO
+# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR7)
+# define CONFIG_XILINX_LL_TEMAC7_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR7
+# define CONFIG_XILINX_LL_TEMAC7_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE
+# else
+# error "missing sub-controller base address for LLTEMAC7"
+# endif
+#endif
+
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h
index 71d4767..81a7905 100644
--- a/include/configs/microblaze-generic.h
+++ b/include/configs/microblaze-generic.h
@@ -26,6 +26,7 @@
#define __CONFIG_H
#include "../board/xilinx/microblaze-generic/xparameters.h"
+#include "../board/xilinx/microblaze-generic/xconversions.h"
/* MicroBlaze CPU */
#define CONFIG_MICROBLAZE 1
--
1.7.0.4
More information about the U-Boot
mailing list