[U-Boot] [PATCH v9 2/7] arm: add Faraday SoC helper files

Kuo-Jung Su
2014-01-16T08:31:51Z

1. arch/arm/include/asm/faraday.h:
Faraday SoC header file

2. include/configs/faraday-common.h:
Faraday SoC common/default configurations

Signed-off-by: Kuo-Jung Su <dantesu@faraday-tech.com>
CC: Albert Aribaud <albert.u.boot@aribaud.net>
---
Changes for v9:
- Separated as a standalone changeset by first time.

arch/arm/include/asm/faraday.h | 13 ++
include/common.h | 3 +
include/configs/faraday-common.h | 314 ++++++++++++++++++++++++++++++++++++++
3 files changed, 330 insertions(+)
create mode 100644 arch/arm/include/asm/faraday.h
create mode 100644 include/configs/faraday-common.h

diff --git a/arch/arm/include/asm/faraday.h b/arch/arm/include/asm/faraday.h
new file mode 100644
index 0000000..2b59af1
--- /dev/null
+++ b/arch/arm/include/asm/faraday.h
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2013 Faraday Technology
+ * Dante Su <dantesu@faraday-tech.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef _ASM_FARADAY_H
+#define _ASM_FARADAY_H
+
+ulong clk_get_rate(const char *id);
+
+#endif /* EOF */
diff --git a/include/common.h b/include/common.h
index d49c514..eaac828 100644
--- a/include/common.h
+++ b/include/common.h
@@ -94,6 +94,9 @@ typedef volatile unsigned char vu_char;
#ifdef CONFIG_SOC_DA8XX
#include <asm/arch/hardware.h>
#endif
+#ifdef CONFIG_SOC_FARADAY
+#include <asm/faraday.h>
+#endif

#include <part.h>
#include <flash.h>
diff --git a/include/configs/faraday-common.h b/include/configs/faraday-common.h
new file mode 100644
index 0000000..546c0a9
--- /dev/null
+++ b/include/configs/faraday-common.h
@@ -0,0 +1,314 @@
+/*
+ * (C) Copyright 2013
+ * Faraday Technology Corporation. <http://www.faraday-tech.com/>
+ * Kuo-Jung Su <dantesu@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __CONFIG_FARADAY_COMMON_H
+#define __CONFIG_FARADAY_COMMON_H
+
+/* Faraday SoC Platform */
+#define CONFIG_SOC_FARADAY
+#define CONFIG_MACH_TYPE 758 /* Faraday */
+
+/* Faraday ARMv5TE cores are 32 bytes per line */
+#define CONFIG_SYS_CACHELINE_SIZE 32
+
+#ifdef CONFIG_SPL_BUILD
+# undef CONFIG_USE_IRQ
+# ifndef CONFIG_SYS_DCACHE_OFF
+# define CONFIG_SYS_DCACHE_OFF
+# endif
+# ifndef CONFIG_SYS_THUMB_BUILD
+# define CONFIG_SYS_THUMB_BUILD
+# endif
+#endif /* CONFIG_SPL_BUILD */
+
+#define CONFIG_BOARD_EARLY_INIT_F
+
+#define CONFIG_DISPLAY_CPUINFO
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+# define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
+#endif
+
+#ifdef CONFIG_USE_IRQ
+# define CONFIG_STACKSIZE_IRQ SZ_32K
+# define CONFIG_STACKSIZE_FIQ SZ_32K
+#endif
+
+#define CONFIG_SYS_HZ 1000
+
+/*
+ * Initial stack pointer: GENERATED_GBL_DATA_SIZE in internal SRAM.
+ * Inside the board_init_f, the gd is first assigned to
+ * (CONFIG_SYS_INIT_SP_ADDR) & ~0x07) and then relocated to DRAM
+ * while calling relocate_code.
+ */
+#define CONFIG_SYS_INIT_SP_ADDR \
+ (CONFIG_SYS_SDRAM_BASE + SZ_4K - GENERATED_GBL_DATA_SIZE)
+
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
+#define CONFIG_SYS_MONITOR_LEN SZ_512K
+
+#ifndef CONFIG_CONSISTENT_DMA_START
+#define CONFIG_CONSISTENT_DMA_START 0xff000000
+#endif
+
+#ifndef CONFIG_CONSISTENT_DMA_END
+#define CONFIG_CONSISTENT_DMA_END 0xfff00000
+#endif
+
+/* Default entry point */
+#ifndef CONFIG_SYS_UBOOT_START
+#define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE
+#endif
+
+/* Default load address */
+#ifndef CONFIG_SYS_LOAD_ADDR
+#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_8M)
+#endif
+
+/* U-Boot's built-in memory test */
+#ifndef CONFIG_SYS_MEMTEST_START
+#define CONFIG_SYS_MEMTEST_START (CONFIG_SYS_SDRAM_BASE + SZ_8M)
+#endif
+
+#ifndef CONFIG_SYS_MEMTEST_END
+#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + SZ_32M)
+#endif
+
+/*
+ * Serial driver
+ */
+#ifdef CONFIG_FTUART010
+# ifndef CONFIG_FTUART010_CLK
+# define CONFIG_FTUART010_CLK 18432000
+# endif
+# ifndef CONFIG_BAUDRATE
+# define CONFIG_BAUDRATE 38400
+# endif
+# undef CONFIG_HWFLOW
+# undef CONFIG_MODEM_SUPPORT
+# define CONFIG_SYS_NS16550
+# define CONFIG_SYS_NS16550_SERIAL
+# define CONFIG_SYS_NS16550_CLK CONFIG_FTUART010_CLK
+# define CONFIG_SYS_NS16550_COM1 CONFIG_FTUART010_BASE
+# define CONFIG_SYS_NS16550_MEM32
+# define CONFIG_SYS_NS16550_REG_SIZE (-4)
+# define CONFIG_CONS_INDEX 1
+#endif /* CONFIG_FTUART010 */
+
+/*
+ * NIC driver
+ */
+#ifdef CONFIG_FTGMAC100
+# define CONFIG_FTGMAC100_EGIGA
+# define CONFIG_PHY_GIGE /* Enable giga phy support for miiphyutil.c */
+#endif
+
+#if defined(CONFIG_FTMAC110) || defined(CONFIG_FTGMAC100)
+# define CONFIG_PHY_MAX_ADDR 32
+# define CONFIG_RANDOM_MACADDR
+# define CONFIG_MII
+# define CONFIG_NET_MULTI
+# define CONFIG_NET_RETRY_COUNT 20
+# define CONFIG_DRIVER_ETHER
+# define CONFIG_CMD_MII
+# define CONFIG_CMD_PING
+#endif /* CONFIG_FTMAC110 || CONFIG_FTGMAC100 */
+
+#ifndef CONFIG_ETHADDR
+#define CONFIG_ETHADDR 00:41:71:00:00:50
+#endif
+
+#ifndef CONFIG_IPADDR
+#define CONFIG_IPADDR 10.0.0.192
+#endif
+
+#ifndef CONFIG_NETMASK
+#define CONFIG_NETMASK 255.255.255.0
+#endif
+
+#ifndef CONFIG_SERVERIP
+#define CONFIG_SERVERIP 10.0.0.128
+#endif
+
+/*
+ * I2C bus driver
+ */
+#ifdef CONFIG_FTI2C010
+# define CONFIG_SYS_I2C_FTI2C010
+#endif
+#ifdef CONFIG_SYS_I2C_FTI2C010
+# define CONFIG_SYS_I2C
+# define CONFIG_SYS_I2C_SPEED 5000
+# define CONFIG_SYS_I2C_SLAVE 0
+# define CONFIG_CMD_I2C
+# define CONFIG_I2C_CMD_TREE
+#endif /* CONFIG_FTI2C010 */
+
+/*
+ * I2C-EEPROM
+ */
+#ifdef CONFIG_ENV_EEPROM_IS_ON_I2C
+# define CONFIG_CMD_EEPROM
+# define CONFIG_SYS_I2C_MULTI_EEPROMS
+# ifndef CONFIG_SYS_EEPROM_PAGE_WRITE_BITS
+# define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
+# endif
+# ifndef CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS
+# define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10
+# endif
+# ifndef CONFIG_SYS_I2C_EEPROM_ADDR_LEN
+# define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+# endif
+#endif
+
+/*
+ * NAND flash controller
+ */
+#ifdef CONFIG_FTNANDC021
+# define CONFIG_NAND_FTNANDC021
+#endif
+#ifdef CONFIG_SYS_NAND_BASE
+# define CONFIG_MTD_NAND_VERIFY_WRITE
+# define CONFIG_CMD_NAND
+# define CONFIG_CMD_NAND_YAFFS
+#endif
+
+/*
+ * NOR flash driver
+ */
+#ifdef CONFIG_SYS_FLASH_BASE
+# define CONFIG_SYS_FLASH_CFI
+# define CONFIG_FLASH_CFI_DRIVER
+# define CFG_FLASH_EMPTY_INFO /* 'E' for empty sector on flinfo */
+# define CONFIG_CMD_IMLS
+# define CONFIG_CMD_FLASH
+#else
+# define CONFIG_SYS_NO_FLASH
+#endif /* !CONFIG_SYS_NO_FLASH */
+
+/*
+ * MMC/SD
+ */
+#ifdef CONFIG_FTSDC010
+# define CONFIG_FTSDC010_SDIO /* HW is configured with SDIO support */
+#endif
+
+#ifdef CONFIG_FTSDC021
+# define CONFIG_SDHCI
+#endif
+
+#if defined(CONFIG_FTSDC010) || defined(CONFIG_FTSDC021)
+# define CONFIG_MMC
+# define CONFIG_CMD_MMC
+# define CONFIG_GENERIC_MMC
+#endif
+
+/*
+ * USB EHCI
+ */
+#if CONFIG_USB_MAX_CONTROLLER_COUNT > 0
+# define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 1
+# ifndef CONFIG_USB_HUB_MIN_POWER_ON_DELAY
+# define CONFIG_USB_HUB_MIN_POWER_ON_DELAY 500
+# endif
+# define CONFIG_USB_EHCI
+# define CONFIG_USB_EHCI_FARADAY
+# define CONFIG_EHCI_IS_TDI
+# define CONFIG_CMD_USB
+# define CONFIG_USB_STORAGE
+#endif
+
+/*
+ * USB Gadget
+ */
+#ifdef CONFIG_USB_ETHER
+# ifndef CONFIG_USBNET_DEV_ADDR
+# define CONFIG_USBNET_DEV_ADDR "00:41:71:00:00:55" /* U-Boot */
+# endif
+# ifndef CONFIG_USBNET_HOST_ADDR
+# define CONFIG_USBNET_HOST_ADDR "00:41:71:00:00:54" /* Host PC */
+# endif
+#endif
+
+#ifdef CONFIG_USBDOWNLOAD_GADGET
+# ifndef CONFIG_G_DNL_MANUFACTURER
+# define CONFIG_G_DNL_MANUFACTURER "Faraday"
+# endif
+# ifndef CONFIG_G_DNL_VENDOR_NUM
+# define CONFIG_G_DNL_VENDOR_NUM 0x1d50 /* OpenMoko */
+# endif
+# ifndef CONFIG_G_DNL_PRODUCT_NUM
+# define CONFIG_G_DNL_PRODUCT_NUM 0x5119
+# endif
+#endif
+
+#ifdef CONFIG_DFU_FUNCTION
+# ifndef CONFIG_SYS_DFU_DATA_BUF_SIZE
+# define CONFIG_SYS_DFU_DATA_BUF_SIZE 4096
+# endif
+#endif
+
+/*
+ * U-Boot General Configurations
+ */
+#define CONFIG_LZMA /* Support LZMA */
+#define CONFIG_VERSION_VARIABLE /* Include version env variable */
+
+/* Console I/O Buffer Size */
+#define CONFIG_SYS_CBSIZE 256
+
+/* Max number of command args */
+#define CONFIG_SYS_MAXARGS 32
+
+/* Print Buffer Size */
+#define CONFIG_SYS_PBSIZE \
+ (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
+
+/*
+ * Shell
+ */
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2 "$ "
+#define CONFIG_SYS_PROMPT "=> "
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_CMDLINE_EDITING
+
+/*
+ * FAT Filesystem
+ */
+#if defined(CONFIG_USB_STORAGE) || defined(CONFIG_MMC)
+# define CONFIG_DOS_PARTITION
+# define CONFIG_CMD_FAT
+#endif
+
+/*
+ * Linux Kernel Command Line
+ */
+#define CONFIG_INITRD_TAG
+#define CONFIG_CMDLINE_TAG /* support ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS
+
+/*
+ * Default Commands
+ */
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_CMD_AUTOSCRIPT /* support autoscript */
+#define CONFIG_CMD_BDI /* bdinfo */
+#define CONFIG_CMD_ECHO /* echo arguments */
+#define CONFIG_CMD_ENV /* printenv */
+#define CONFIG_CMD_MEMORY /* md mm nm mw ... */
+#define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */
+#define CONFIG_CMD_RUN /* run command in env variable */
+#define CONFIG_CMD_ELF /* support ELF files */
+#define CONFIG_CMD_LOADB /* xyzModem */
+#ifndef CONFIG_ENV_IS_NOWHERE
+# define CONFIG_CMD_SAVEENV /* saveenv */
+#endif
+
+#endif /* EOF */
--
1.7.9.5