blob: 1c30a47bf1bb32f5845546f520ac94efbf7c6c2d [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 __ONYX_CORE_H
#define __ONYX_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_DBG_MONITOR*/
/* uncomment for PLUGIN mode support */
/* #define CONFIG_USE_PLUGIN */
/* uncomment for SECURE mode support */
#define CONFIG_SECURE_BOOT
#define CONFIG_FIT 1
#define CONFIG_FIT_VERBOSE 1
#define CONFIG_FIT_SIGNATURE
#define CONFIG_RSA
#define CONFIG_RSA_IMX
#define CONFIG_CMDLINE_TAG
#define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_INITRD_TAG
#define CONFIG_REVISION_TAG
/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN (16 * SZ_1M)
#define CONFIG_SYS_GENERIC_BOARD
#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
#undef CONFIG_CMD_EXPORTENV
#undef CONFIG_CMD_IMPORTENV
#undef CONFIG_CMD_GO
/* allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE
#define CONFIG_CONS_INDEX 1
/* I2C configs */
#define CONFIG_CMD_I2C
#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)
/* GPIO command */
#define CONFIG_CMD_GPIO
/* Command definition */
#define CONFIG_CMD_MISC /* Misc functions like sleep etc*/
#define CONFIG_CMD_RUN /* run command in env variable */
#undef CONFIG_CMD_IMLS
/*
* 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 5
#define CONFIG_CMD_MEMORY /* md mm nm mw cp cmp crc base loop */
#define CONFIG_LOADADDR 0x80800000
#define CONFIG_SYS_TEXT_BASE 0x80800000
#define MTD_PARTITION_UBI "ubipart"
#define FINAL_BOOTM_COMMAND "bootm ${fit_addr}#${nlmodel} || bootm ${fit_addr}"
#ifndef CONFIG_BACKLIGHT_PARAM
#define CONFIG_BACKLIGHT_PARAM
#endif
#define CONFIG_MFG_ENV_SETTINGS \
"mfgtool_args=" \
"setenv bootargs console=${console},${baudrate} " \
"rdinit=/sbin/init " \
"root=/dev/initrd rootfstype=ramfs rootwait " \
"\0" \
"bootcmd_mfg=run mfgtool_args; run 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 \
"&& run 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_SYS_HZ 1000
#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_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_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_CONTROL 1
#define CONFIG_OF_EMBED 1
#define CONFIG_OF_LIBFDT
#define CONFIG_ENV_WHITELIST \
"bootside", \
"brightness", \
"nlmodel", \
#undef CONFIG_CMD_NET
#endif /* __ONYX_CORE_H */