Re: [U-Boot] [PATCH 5/5] [PATCH 5/5] Add config file for the apf27

2012-07-07 Thread Stefano Babic
On 28/06/2012 22:36, Philippe Reynes wrote:
 Signed-off-by: Philippe Reynes trem...@yahoo.fr
 ---

Hi Philippe,

  include/configs/apf27.h |  916 
 +++
  1 files changed, 916 insertions(+), 0 deletions(-)
  create mode 100644 include/configs/apf27.h
 
 diff --git a/include/configs/apf27.h b/include/configs/apf27.h
 new file mode 100644

Really this patch must be merged with patch 2/5: Add support for the
armadeus APF27. They belong together, and it maintains the tree bisectable.

 +
 +#ifndef __CONFIG_H
 +#define __CONFIG_H
 +
 +#define CONFIG_VERSION_VARIABLE
 +#define CONFIG_ENV_VERSION   3.1
 +#define CONFIG_IDENT_STRING   apf27 patch 3.6
 +#define CONFIG_BOARD_NAMEapf27
 +
 +/*
 + * SoC configurations
 + */
 +#define CONFIG_ARM926EJS /* this is an ARM926EJS CPU */
 +#define CONFIG_MX27  /* in a Freescale i.MX27 Chip */
 +#define CONFIG_MACH_TYPE 1698/* APF27 */
 +
 +/*
 + * Enable the call to miscellaneous platform dependent initialization.
 + */
 +#define CONFIG_SYS_NO_FLASH  /* to be define before config_cmd_default.h */
 +#define CONFIG_SYS_DCACHE_OFF
 +#define CONFIG_MISC_INIT_R
 +
 +/*
 + * Board display option
 + */
 +#define CONFIG_DISPLAY_BOARDINFO
 +#define CONFIG_DISPLAY_CPUINFO
 +
 +/*
 + * SPL
 + */
 +#define CONFIG_NAND_U_BOOT
 +/* Copy SPL+U-Boot here   */
 +#define CONFIG_SYS_NAND_U_BOOT_DST   CONFIG_SYS_LOAD_ADDR
 +/* Size is the partion size  */
 +#define CONFIG_SYS_NAND_U_BOOT_SIZE  CONFIG_SYS_MONITOR_LEN

See my comment about the SPL patch.

 +
 +#define PHYS_SDRAM_1 0xA000
 +#define PHYS_SDRAM_2 0xB000
 +#define CONFIG_SYS_SDRAM_BASEPHYS_SDRAM_1
 +#define CONFIG_SYS_MALLOC_LEN(CONFIG_ENV_SIZE + (51210))
 +#define CONFIG_SYS_GBL_DATA_SIZE 256 /* Initial data */

We use a macro for CONFIG_SYS_GBL_DATA_SIZE. Is it not suitable for your
needs ?

 +#define CONFIG_SYS_TEXT_BASE 0xA100
 +
 +/*
 + * FLASH organization
 + */
 +/*#defineCONFIG_SYS_MONITOR_BASE 0xAFF0*/

Do not let dead code

 +#define  CONFIG_FIRMWARE_OFFSET  0x0020
 +#define  CONFIG_KERNEL_OFFSET0x0030
 +#define  CONFIG_ROOTFS_OFFSET0x0080
 +
 +#define CONFIG_MTDMAPmxc_nand.0
 +#define MTDIDS_DEFAULT   nand0= CONFIG_MTDMAP
 +#define MTDPARTS_DEFAULT mtdparts= CONFIG_MTDMAP \
 + :1M(u-boot)ro, \
 + 512K(env), \
 + 512K(env2), \
 + 512K(firmware), \
 + 512K(dtb), \
 + 5M(kernel), \
 + -(rootfs)
 +
 +/*
 + * U-Boot general configurations
 + */
 +#define CONFIG_SYS_LONGHELP
 +#define CONFIG_SYS_PROMPTBIOS /* prompt string */
 +#define CONFIG_SYS_CBSIZE2048/* console I/O buffer */
 +#define CONFIG_SYS_PBSIZE\
 + (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
 + /* Print buffer size */
 +#define CONFIG_SYS_MAXARGS   16  /* max command args */
 +#define CONFIG_SYS_BARGSIZE  CONFIG_SYS_CBSIZE
 + /* Boot argument buffer size */
 +#define CONFIG_AUTO_COMPLETE
 +#define CONFIG_CMDLINE_EDITING
 +#define CONFIG_SYS_HUSH_PARSER   /* enable the hush 
 shell */
 +#define CONFIG_SYS_PROMPT_HUSH_PS2/* secondary prompt string */
 +
 +/*
 + * Boot Linux
 + */
 +#define CONFIG_CMDLINE_TAG   /* send commandline to Kernel   */
 +#define CONFIG_SETUP_MEMORY_TAGS /* send memory definition to kernel */
 +#define CONFIG_INITRD_TAG/* send initrd params   */
 +
 +/* #define CONFIG_REVISION_TAG */

Drop also this line - check in the whole file for these occurrencies


 +#if 0
 +#define CONFIG_SYS_FPGA_IS_PROTO /* to be defined with apf27 board prototype 
 */
 +#endif

drop also this dead code

 +#ifndef CONFIG_MX27_CLK26
 +#if (CONFIG_MX27_CLK32 == 32000)
 +#define CONFIG_SYS_MPCTL0_VAL0x00211803  /* 398.998 MHz 
 */
 +#define CONFIG_SYS_MPCTL1_VAL0
 +#define CONFIG_MPLL_FREQ 399
 +#else /* CONFIG_MX27_CLK32 == 32768*/
 +#define CONFIG_SYS_MPCTL0_VAL0x01EF15D5  /* 399.000 MHz 
 */
 +#define CONFIG_SYS_MPCTL1_VAL0
 +#define CONFIG_MPLL_FREQ 399
 +#endif /* CONFIG_MX27_CLK32 */
 +#else /* CONFIG_MX27_CLK26 in use*/
 +#define CONFIG_SYS_MPCTL0_VAL0x00331C23  /* 399.000 MHz 
 */
 +#define CONFIG_SYS_MPCTL1_VAL0
 +#define CONFIG_MPLL_FREQ 399
 +#endif /* CONFIG_MX27_CLK26 */

Do you have several hardware version of the same board or which is the
reason for that ?

 +/* ARM bus frequency (have to be a 

[U-Boot] [PATCH 5/5] [PATCH 5/5] Add config file for the apf27

2012-06-28 Thread Philippe Reynes
Signed-off-by: Philippe Reynes trem...@yahoo.fr
---
 include/configs/apf27.h |  916 +++
 1 files changed, 916 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/apf27.h

diff --git a/include/configs/apf27.h b/include/configs/apf27.h
new file mode 100644
index 000..985fa1a
--- /dev/null
+++ b/include/configs/apf27.h
@@ -0,0 +1,916 @@
+/*
+ *
+ * Configuration settings for the Armadeus Project motherboard APF27
+ *
+ * Copyright (C) 2008-2012 ej / Armadeus Project eric.jarr...@armadeus.org
+ *
+ * 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_H
+#define __CONFIG_H
+
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_ENV_VERSION 3.1
+#define CONFIG_IDENT_STRING apf27 patch 3.6
+#define CONFIG_BOARD_NAME  apf27
+
+/*
+ * SoC configurations
+ */
+#define CONFIG_ARM926EJS   /* this is an ARM926EJS CPU */
+#define CONFIG_MX27/* in a Freescale i.MX27 Chip */
+#define CONFIG_MACH_TYPE   1698/* APF27 */
+
+/*
+ * Enable the call to miscellaneous platform dependent initialization.
+ */
+#define CONFIG_SYS_NO_FLASH/* to be define before config_cmd_default.h */
+#define CONFIG_SYS_DCACHE_OFF
+#define CONFIG_MISC_INIT_R
+
+/*
+ * Board display option
+ */
+#define CONFIG_DISPLAY_BOARDINFO
+#define CONFIG_DISPLAY_CPUINFO
+
+/*
+ * SPL
+ */
+#define CONFIG_NAND_U_BOOT
+/* Copy SPL+U-Boot here */
+#define CONFIG_SYS_NAND_U_BOOT_DST CONFIG_SYS_LOAD_ADDR
+/* Size is the partion size  */
+#define CONFIG_SYS_NAND_U_BOOT_SIZECONFIG_SYS_MONITOR_LEN
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+
+#define CONFIG_HOSTNAMECONFIG_BOARD_NAME
+#define CONFIG_ROOTPATH/tftpboot/ MK_STR(CONFIG_BOARD_NAME) 
-root
+
+/*
+ * U-Boot Commands
+ */
+#include config_cmd_default.h
+
+#define CONFIG_CMD_ASKENV  /* ask for env variable */
+#define CONFIG_CMD_BSP /* Board Specific functions */
+#define CONFIG_CMD_CACHE   /* icache, dcache   */
+/*#define CONFIG_CMD_DATE */   /* support for RTC, date/time...*/
+#define CONFIG_CMD_DHCP/* DHCP Support */
+#define CONFIG_CMD_DNS
+/*#define CONFIG_CMD_EEPROM */ /* EEPROM read/write support*/
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT /* FAT support  */
+/*#define CONFIG_CMD_I2C *//* I2C serial bus support   */
+#define CONFIG_CMD_IMX_FUSE/* imx iim fuse */
+#define CONFIG_CMD_MII /* MII support  */
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_MTDPARTS/* MTD partition support*/
+#define CONFIG_CMD_NAND/* NAND support */
+#define CONFIG_CMD_NAND_LOCK_UNLOCK
+#define CONFIG_CMD_NAND_TRIMFFS
+#define CONFIG_CMD_NFS /* NFS support  */
+#define CONFIG_CMD_PING/* ping support */
+#define CONFIG_CMD_SETEXPR /* setexpr support  */
+#define CONFIG_CMD_UBI
+#define CONFIG_CMD_UBIFS
+
+/*
+ * Memory configurations
+ */
+#define CONFIG_NR_DRAM_POPULATED   1
+#define CONFIG_NR_DRAM_BANKS   2
+
+#define CONFIG_SYS_SDRAM_MBYTE_SYZE 64
+
+#define PHYS_SDRAM_1   0xA000
+#define PHYS_SDRAM_2   0xB000
+#define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM_1
+#define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + (51210))
+#define CONFIG_SYS_GBL_DATA_SIZE   256 /* Initial data */
+#define CONFIG_SYS_MEMTEST_START   0xA000  /* memtest test area  */
+#define CONFIG_SYS_MEMTEST_END 0xA030  /* 3 MiB RAM test */
+
+#define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_SDRAM_BASE  \
+   + PHYS_SDRAM_1_SIZE - 0x010)
+
+#define CONFIG_SYS_TEXT_BASE   0xA100
+
+/*
+ * FLASH organization
+ */
+/*#define  CONFIG_SYS_MONITOR_BASE 0xAFF0*/
+#defineCONFIG_SYS_MONITOR_OFFSET   0x
+#defineCONFIG_SYS_MONITOR_LEN  0x0010  /* 1MiB */
+#define CONFIG_ENV_IS_IN_NAND
+#define