blob: 748dec2ea52288adbe971e10b28f2cc23feaff62 [file] [log] [blame]
/*
* Copyright (C) 2014 Nest Labs, Inc.
*
* Configuration settings for the nest board.
*
* 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.
*/
#ifndef __FLINTSTONE_CORE_H
#define __FLINTSTONE_CORE_H
#include <asm/arch/imx-regs.h>
#include <linux/sizes.h>
#define CONFIG_MX6
#define CONFIG_ROM_UNIFIED_SECTIONS
#define CONFIG_DISPLAY_CPUINFO
#define CONFIG_DISPLAY_BOARDINFO
#define CONFIG_SYS_L2_PL310
#define CONFIG_SYS_PL310_BASE 0x00A02000
#define CONFIG_SYS_CACHELINE_SIZE 32
#define CONFIG_DBG_MONITOR
#define CONFIG_GPT_TIMER
/* uncomment for PLUGIN mode support */
/* #define CONFIG_USE_PLUGIN */
/* uncomment for SECURE mode support */
#define CONFIG_SECURE_BOOT
#define CONFIG_IMAGE_FORMAT_LEGACY
#define CONFIG_FIT 1
#define CONFIG_FIT_VERBOSE 1
#define CONFIG_FIT_SIGNATURE
#define CONFIG_CMDLINE_TAG
#define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_INITRD_TAG
#define CONFIG_REVISION_TAG
#define CONFIG_SYS_GENERIC_BOARD
/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN (16 * SZ_1M)
#define CONFIG_BOARD_EARLY_INIT_F
#define CONFIG_BOARD_LATE_INIT
#define CONFIG_MXC_GPIO
#define CONFIG_MXC_UART
#define CONFIG_MXC_UART_BASE UART1_BASE
#define CONFIG_CMD_FUSE
#ifdef CONFIG_CMD_FUSE
#define CONFIG_MXC_OCOTP
#endif
#define CONFIG_BAUDRATE 115200
#undef CONFIG_BOOTM_NETBSD
#undef CONFIG_BOOTM_PLAN9
#undef CONFIG_BOOTM_RTEMS
/* allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE
#define CONFIG_CONS_INDEX 1
/* I2C configs */
#define CONFIG_I2C_MULTI_BUS
#define CONFIG_HARD_I2C
#define CONFIG_SYS_I2C
#define CONFIG_SYS_I2C_MXC
#define CONFIG_SYS_I2C_BASE I2C1_BASE_ADDR
#define CONFIG_SYS_I2C_SPEED 100000
/* PMIC I2C BUS*/
#define CONFIG_PMIC_I2C_BUS 0x3
#define CONFIG_PMIC_I2C_SLAVE 0x8
#define PFUZE200_SWABMODE 0x23
#define PFUZE200_SW2MODE 0x38
#define PFUZE200_SW3AMODE 0x3F
#define PFUZE200_SW3BMODE 0x46
#define PFUZE200_SWMODE_APS_PFM 0xC
#define PFUZE200_SWMODE_APS_APS 0x8
#define PFUZE200_SW1ABVOL 0x20
#define PFUZE200_SW2VOL 0x35
#define PFUZE200_SW1AB_SETP(v) (((v) - 300)/25)
#define PFUZE200_SW2_SETP(v) (((v) - 400)/25)
#define PFUZE200_PWRCTL 0x1B
#define PFUZE200_PWRCTL_STBYDLY_MASK 0x30
#define PFUZE200_PWRCTL_STBYDLY_SHIFT 4
#define PFUZE200_MEMA 0x1C
/* GPIO command */
#define CONFIG_CMD_GPIO
/*
* When secure boot is enabled through the SEC_CONFIG[1] OTP bit, the default
* bootdelay defined here will be overridden if no unlock token is present.
*/
#define CONFIG_BOOTDELAY 0
#define CONFIG_ZERO_BOOTDELAY_CHECK
#define CONFIG_LOADADDR 0x80800000
#define MTD_PARTITION_UBI "ubipart"
#ifdef CONFIG_FCT_DETECTION
/* SD4_RESET_B (GPIO 182) is pulled high but FCT fixture drives it low */
#define FINAL_BOOTM_COMMAND "if gpio input 182; " \
"then bootm ${fit_addr}#${nlmodel}-fct; " \
"else bootm ${fit_addr}#${nlmodel}; " \
"fi"
#else
#define FINAL_BOOTM_COMMAND "bootm ${fit_addr}#${nlmodel}"
#endif
#ifndef CONFIG_BACKLIGHT_PARAM
#define CONFIG_BACKLIGHT_PARAM
#endif
#ifndef CONFIG_FASTMAP_AUTOCONVERT_PARAM
#define CONFIG_FASTMAP_AUTOCONVERT_PARAM
#endif
#ifndef CONFIG_PREBOOT_ANIMATION_PARAM
#define CONFIG_PREBOOT_ANIMATION_PARAM
#endif
#define CONFIG_MFG_ENV_SETTINGS \
"mfgtool_args=setenv initrd_high "PHYS_SDRAM_HIGH"; " \
"setenv bootargs console=${console},${baudrate} " \
"rdinit=/sbin/init " \
"root=/dev/initrd rootfstype=ramfs rootwait " \
CONFIG_FASTMAP_AUTOCONVERT_PARAM"ubi.mtd="MTD_PARTITION_UBI"\0" \
"bootcmd_mfg=run mfgtool_args; " FINAL_BOOTM_COMMAND "\0"
/*
* Define NAND/UBIFS boot environment variables for booting from boot
* partition n.
*/
#define CONFIG_SYS_NANDBOOTN_ENV_SETTINGS(n) \
"nandboot" #n "=ubifsmount ubi0:root"#n" && " \
"ubifsload ${fit_addr} /boot/kernel_fdt.itb && " \
"setenv bootargs console=${console},${baudrate} mtdoops.mtddev=${mtdoopsdev} ubi.mtd="MTD_PARTITION_UBI" root=ubi0:root"#n" rootfstype=ubifs rootwait " \
CONFIG_BACKLIGHT_PARAM \
CONFIG_FASTMAP_AUTOCONVERT_PARAM \
CONFIG_PREBOOT_ANIMATION_PARAM \
"&& " FINAL_BOOTM_COMMAND "\0"
/*
* NAND/UBIFS boot environment variables for booting from boot
* partition 0.
*/
#define CONFIG_SYS_NANDBOOT0_ENV_SETTINGS \
CONFIG_SYS_NANDBOOTN_ENV_SETTINGS(0)
/*
* NAND/UBIFS boot environment variables for booting from boot
* partition 1.
*/
#define CONFIG_SYS_NANDBOOT1_ENV_SETTINGS \
CONFIG_SYS_NANDBOOTN_ENV_SETTINGS(1)
/* Miscellaneous configurable options */
#define CONFIG_SYS_LONGHELP
#define CONFIG_SYS_HUSH_PARSER
#define CONFIG_SYS_PROMPT "=> "
#define CONFIG_AUTO_COMPLETE
#define CONFIG_SYS_CBSIZE 1024
/* Print Buffer Size */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
#define CONFIG_SYS_MAXARGS 256
#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
#define CONFIG_SYS_MEMTEST_START 0x80000000
#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x10000)
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
#define CONFIG_CMDLINE_EDITING
#define CONFIG_STACKSIZE SZ_128K
/* Physical Memory Map */
#define CONFIG_NR_DRAM_BANKS 1
#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
#define CONFIG_SYS_INIT_SP_OFFSET \
(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
#define CONFIG_SYS_INIT_SP_ADDR \
(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
/* FLASH and environment organization */
#define CONFIG_SYS_NO_FLASH
#define CONFIG_ENV_SIZE SZ_64K /* 0x00010000 */
#define CONFIG_SYS_BOOT_NAND
#define CONFIG_SYS_USE_NAND
#define CONFIG_ENV_UBI_PART MTD_PARTITION_UBI
#define CONFIG_ENV_UBI_VOLUME "env0"
#define CONFIG_ENV_UBI_VOLUME_REDUND "env1"
/* Documentation says "You will probably want to define these to avoid a really noisy system when storing the env in UBI." */
#define CONFIG_UBI_SILENCE_MSG
#define CONFIG_UBIFS_SILENCE_MSG
#ifdef CONFIG_SYS_USE_NAND
#define CONFIG_CMD_UBI
#define CONFIG_CMD_UBIFS
#define CONFIG_RBTREE
#define CONFIG_MTD_DEVICE
#define CONFIG_MTD_PARTITIONS
#define CONFIG_CMD_MTDPARTS
#define CONFIG_LZO
/* NAND stuff */
#define CONFIG_NAND_MXS
#define CONFIG_NAND_MXS_BCH_LEGACY_GEO
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define CONFIG_SYS_NAND_BASE 0x40000000 /* Build requires this, but doesn't use it */
#define CONFIG_SYS_NAND_5_ADDR_CYCLE
#define CONFIG_SYS_NAND_ONFI_DETECTION
#define CONFIG_SYS_NAND_USE_FLASH_BBT
/* Optionally enable mtd debug */
#if 0
#define CONFIG_MTD_DEBUG
#define CONFIG_MTD_DEBUG_VERBOSE 7
#endif
/* DMA stuff, needed for GPMI/MXS NAND support */
#define CONFIG_APBH_DMA
#define CONFIG_APBH_DMA_BURST
#define CONFIG_APBH_DMA_BURST8
#endif
#define CONFIG_OF_LIBFDT
/* Support for parsing PLISTs in UBIFS volumes */
#define CONFIG_NEST_PLIST
#define CONFIG_PLIST_NLMODEL
#define CONFIG_PLIST_BOOTSIDE
#define CONFIG_HW_WATCHDOG
#define CONFIG_IMX_WATCHDOG
#endif /* __FLINTSTONE_H */