[U-Boot] [PATCH V2] Fix FIT and fdt blob support to have CONFIG_OF_LIBFDT and CONFIG_FIT independant
Jean-Christophe PLAGNIOL-VILLARD
plagnioj at jcrosoft.com
Thu Nov 20 22:59:04 CET 2008
FDT support is used for both FIT style images and architectures (ppc, m68k, sparc)
that can pass a fdt blob to an OS..
For other arch and board which do not pass a fdt blob to an OS but want to use
the new uImage format, we just need FIT support (ex : ARM).
Now we can have the 4 following configurations :
1) FIT only CONFIG_FIT
2) fdt blob only CONFIG_OF_LIBFDT
3) both CONFIG_OF_LIBFDT & CONFIG_FIT
4) none none
And remove arch macro ifdef and use 2 new config for the functionnality to enable
so we introduce these :
CONFIG_BOOT_INIT_RAMDISK
Define this if you want support for relocating init ramdisk
CONFIG_BOOT_INIT_RAMDISK
Define this if you want support for allocate and initialize kernel
information for booting
and create a new arch default config where these new are manage for ppc, m68k,
sparc actually via include/configs/{arch}/default.h
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
README | 9 +++++++++
common/image.c | 6 ++++--
include/configs/arm/default.h | 29 +++++++++++++++++++++++++++++
include/configs/avr32/default.h | 29 +++++++++++++++++++++++++++++
include/configs/blackfin/default.h | 29 +++++++++++++++++++++++++++++
include/configs/i386/default.h | 29 +++++++++++++++++++++++++++++
include/configs/m68k/default.h | 32 ++++++++++++++++++++++++++++++++
include/configs/microblaze/default.h | 29 +++++++++++++++++++++++++++++
include/configs/mips/default.h | 29 +++++++++++++++++++++++++++++
include/configs/nios/default.h | 29 +++++++++++++++++++++++++++++
include/configs/nios2/default.h | 29 +++++++++++++++++++++++++++++
include/configs/ppc/default.h | 32 ++++++++++++++++++++++++++++++++
include/configs/sh/default.h | 29 +++++++++++++++++++++++++++++
include/configs/sparc/default.h | 31 +++++++++++++++++++++++++++++++
include/image.h | 4 ----
libfdt/Makefile | 7 +++++--
mkconfig | 1 +
17 files changed, 375 insertions(+), 8 deletions(-)
create mode 100644 include/configs/arm/default.h
create mode 100644 include/configs/avr32/default.h
create mode 100644 include/configs/blackfin/default.h
create mode 100644 include/configs/i386/default.h
create mode 100644 include/configs/m68k/default.h
create mode 100644 include/configs/microblaze/default.h
create mode 100644 include/configs/mips/default.h
create mode 100644 include/configs/nios/default.h
create mode 100644 include/configs/nios2/default.h
create mode 100644 include/configs/ppc/default.h
create mode 100644 include/configs/sh/default.h
create mode 100644 include/configs/sparc/default.h
diff --git a/README b/README
index 9455fa7..108118a 100644
--- a/README
+++ b/README
@@ -381,6 +381,15 @@ The following options need to be configured:
This define fills in the correct boot CPU in the boot
param header, the default value is zero if undefined.
+ CONFIG_BOOT_INIT_RAMDISK
+
+ Define this if you want support for relocating init ramdisk
+
+ CONFIG_BOOT_INIT_KERNEL_INFO
+
+ Define this if you want support for allocate and initialize kernel
+ information for booting
+
- Serial Ports:
CONFIG_PL010_SERIAL
diff --git a/common/image.c b/common/image.c
index 866edf6..5bb3309 100644
--- a/common/image.c
+++ b/common/image.c
@@ -982,7 +982,7 @@ int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
return 0;
}
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
+#if defined(CONFIG_BOOT_INIT_RAMDISK)
/**
* boot_ramdisk_high - relocate init ramdisk
* @lmb: pointer to lmb handle, will be used for memory mgmt
@@ -1071,6 +1071,7 @@ int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, ulong rd_len,
error:
return -1;
}
+#endif /* CONFIG_BOOT_INIT_RAMDISK */
#ifdef CONFIG_OF_LIBFDT
static void fdt_error (const char *msg)
@@ -1575,6 +1576,7 @@ error:
}
#endif /* CONFIG_OF_LIBFDT */
+#if defined(CONFIG_BOOT_INIT_KERNEL_INFO)
/**
* boot_get_cmdline - allocate and initialize kernel cmdline
* @lmb: pointer to lmb handle, will be used for memory mgmt
@@ -1649,7 +1651,7 @@ int boot_get_kbd (struct lmb *lmb, bd_t **kbd, ulong bootmap_base)
return 0;
}
-#endif /* CONFIG_PPC || CONFIG_M68K */
+#endif /* CONFIG_BOOT_INIT_KERNEL_INFO */
#endif /* !USE_HOSTCC */
#if defined(CONFIG_FIT)
diff --git a/include/configs/arm/default.h b/include/configs/arm/default.h
new file mode 100644
index 0000000..7faa8f8
--- /dev/null
+++ b/include/configs/arm/default.h
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2008
+ * Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
+ *
+ * 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
+ */
+
+#ifndef _CONFIG_ARM_DEFAULT_H_
+#define _CONFIG_ARM_DEFAULT_H_
+
+/* define hear always active CONFIG_ for arm */
+
+#endif /* _CONFIG_ARM_DEFAULT_H_ */
diff --git a/include/configs/avr32/default.h b/include/configs/avr32/default.h
new file mode 100644
index 0000000..abcd9eb
--- /dev/null
+++ b/include/configs/avr32/default.h
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2008
+ * Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
+ *
+ * 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
+ */
+
+#ifndef _CONFIG_AVR32_DEFAULT_H_
+#define _CONFIG_AVR32_DEFAULT_H_
+
+/* define hear always active CONFIG_ for avr32 */
+
+#endif /* _CONFIG_AVR32_DEFAULT_H_ */
diff --git a/include/configs/blackfin/default.h b/include/configs/blackfin/default.h
new file mode 100644
index 0000000..4d6c125
--- /dev/null
+++ b/include/configs/blackfin/default.h
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2008
+ * Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
+ *
+ * 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
+ */
+
+#ifndef _CONFIG_BLACKFIN_DEFAULT_H_
+#define _CONFIG_BLACKFIN_DEFAULT_H_
+
+/* define hear always active CONFIG_ for blackfin */
+
+#endif /* _CONFIG_BLACKFIN_DEFAULT_H_ */
diff --git a/include/configs/i386/default.h b/include/configs/i386/default.h
new file mode 100644
index 0000000..d0b79a4
--- /dev/null
+++ b/include/configs/i386/default.h
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2008
+ * Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
+ *
+ * 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
+ */
+
+#ifndef _CONFIG_I386_DEFAULT_H_
+#define _CONFIG_I386_DEFAULT_H_
+
+/* define hear always active CONFIG_ for i386 */
+
+#endif /* _CONFIG_I386_DEFAULT_H_ */
diff --git a/include/configs/m68k/default.h b/include/configs/m68k/default.h
new file mode 100644
index 0000000..cf02586
--- /dev/null
+++ b/include/configs/m68k/default.h
@@ -0,0 +1,32 @@
+/*
+ * (C) Copyright 2008
+ * Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
+ *
+ * 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
+ */
+
+#ifndef _CONFIG_M68K_DEFAULT_H_
+#define _CONFIG_M68K_DEFAULT_H_
+
+/* define hear always active CONFIG_ for m68k */
+
+#define CONFIG_BOOT_INIT_KERNEL_INFO /* init kernel information for booting */
+#define CONFIG_BOOT_INIT_RAMDISK /* init init ramdisk for booting */
+
+#endif /* _CONFIG_M68K_DEFAULT_H_ */
diff --git a/include/configs/microblaze/default.h b/include/configs/microblaze/default.h
new file mode 100644
index 0000000..e3449ab
--- /dev/null
+++ b/include/configs/microblaze/default.h
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2008
+ * Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
+ *
+ * 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
+ */
+
+#ifndef _CONFIG_MICROBLAZE_DEFAULT_H_
+#define _CONFIG_MICROBLAZE_DEFAULT_H_
+
+/* define hear always active CONFIG_ for microblaze */
+
+#endif /* _CONFIG_MICROBLAZE_DEFAULT_H_ */
diff --git a/include/configs/mips/default.h b/include/configs/mips/default.h
new file mode 100644
index 0000000..438f676
--- /dev/null
+++ b/include/configs/mips/default.h
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2008
+ * Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
+ *
+ * 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
+ */
+
+#ifndef _CONFIG_MIPS_DEFAULT_H_
+#define _CONFIG_MIPS_DEFAULT_H_
+
+/* define hear always active CONFIG_ for mips */
+
+#endif /* _CONFIG_MIPS_DEFAULT_H_ */
diff --git a/include/configs/nios/default.h b/include/configs/nios/default.h
new file mode 100644
index 0000000..fd9715a
--- /dev/null
+++ b/include/configs/nios/default.h
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2008
+ * Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
+ *
+ * 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
+ */
+
+#ifndef _CONFIG_NIOS_DEFAULT_H_
+#define _CONFIG_NIOS_DEFAULT_H_
+
+/* define hear always active CONFIG_ for nios */
+
+#endif /* _CONFIG_NIOS_DEFAULT_H_ */
diff --git a/include/configs/nios2/default.h b/include/configs/nios2/default.h
new file mode 100644
index 0000000..cdeef3f
--- /dev/null
+++ b/include/configs/nios2/default.h
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2008
+ * Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
+ *
+ * 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
+ */
+
+#ifndef _CONFIG_NIOS2_DEFAULT_H_
+#define _CONFIG_NIOS2_DEFAULT_H_
+
+/* define hear always active CONFIG_ for nios2 */
+
+#endif /* _CONFIG_NIOS2_DEFAULT_H_ */
diff --git a/include/configs/ppc/default.h b/include/configs/ppc/default.h
new file mode 100644
index 0000000..f134d4c
--- /dev/null
+++ b/include/configs/ppc/default.h
@@ -0,0 +1,32 @@
+/*
+ * (C) Copyright 2008
+ * Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
+ *
+ * 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
+ */
+
+#ifndef _CONFIG_PPC_DEFAULT_H_
+#define _CONFIG_PPC_DEFAULT_H_
+
+/* define hear always active CONFIG_ for ppc */
+
+#define CONFIG_BOOT_INIT_KERNEL_INFO /* init kernel information for booting */
+#define CONFIG_BOOT_INIT_RAMDISK /* init init ramdisk for booting */
+
+#endif /* _CONFIG_PPC_DEFAULT_H_ */
diff --git a/include/configs/sh/default.h b/include/configs/sh/default.h
new file mode 100644
index 0000000..63e6d75
--- /dev/null
+++ b/include/configs/sh/default.h
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2008
+ * Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
+ *
+ * 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
+ */
+
+#ifndef _CONFIG_SH_DEFAULT_H_
+#define _CONFIG_SH_DEFAULT_H_
+
+/* define hear always active CONFIG_ for sh */
+
+#endif /* _CONFIG_SH_DEFAULT_H_ */
diff --git a/include/configs/sparc/default.h b/include/configs/sparc/default.h
new file mode 100644
index 0000000..fb0902e
--- /dev/null
+++ b/include/configs/sparc/default.h
@@ -0,0 +1,31 @@
+/*
+ * (C) Copyright 2008
+ * Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
+ *
+ * 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
+ */
+
+#ifndef _CONFIG_SPARC_DEFAULT_H_
+#define _CONFIG_SPARC_DEFAULT_H_
+
+/* define hear always active CONFIG_ for sparc */
+
+#define CONFIG_BOOT_INIT_RAMDISK /* init init ramdisk for booting */
+
+#endif /* _CONFIG_SPARC_DEFAULT_H_ */
diff --git a/include/image.h b/include/image.h
index 5433555..4609200 100644
--- a/include/image.h
+++ b/include/image.h
@@ -50,10 +50,6 @@
#endif /* USE_HOSTCC */
-#if defined(CONFIG_FIT) && !defined(CONFIG_OF_LIBFDT)
-#error "CONFIG_OF_LIBFDT not enabled, required by CONFIG_FIT!"
-#endif
-
#include <command.h>
#if defined(CONFIG_FIT)
diff --git a/libfdt/Makefile b/libfdt/Makefile
index ca2ad76..54c9aea 100644
--- a/libfdt/Makefile
+++ b/libfdt/Makefile
@@ -27,9 +27,12 @@ LIB = $(obj)libfdt.a
SOBJS =
-COBJS-$(CONFIG_OF_LIBFDT) += fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_sw.o fdt_wip.o
+COBJS-libfdt += fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_sw.o fdt_wip.o
-COBJS := $(COBJS-y)
+COBJS-$(CONFIG_OF_LIBFDT) += $(COBJS-libfdt)
+COBJS-$(CONFIG_FIT) += $(COBJS-libfdt)
+
+COBJS := $(sort $(COBJS-y))
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/mkconfig b/mkconfig
index c3e4cea..6ab8fed 100755
--- a/mkconfig
+++ b/mkconfig
@@ -82,6 +82,7 @@ else
> config.h # Create new config file
fi
echo "/* Automatically generated - do not edit */" >>config.h
+echo "#include <configs/$2/default.h>" >>config.h
echo "#include <configs/$1.h>" >>config.h
exit 0
--
1.5.6.5
More information about the U-Boot
mailing list