blob: 3740acb1016e65e4497904e57d4b689634bbc440 [file] [log] [blame]
/*
* board/amlogic/configs/g12a_estelle_bx.h
*
* Copyright (C) 2015 Amlogic, Inc. All rights reserved.
*
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __G12A_S905D2_ESTELLE_BX_V1_H__
#define __G12A_S905D2_ESTELLE_BX_V1_H__
#include <asm/arch/cpu.h>
#define CONFIG_SYS_GENERIC_BOARD 1
#ifndef CONFIG_AML_MESON
#warning "include warning"
#endif
#define CONFIG_ABR_WEAR_LEVELING
#define CONFIG_ZIRCON_BOOT_IMAGE
#define CONFIG_ZIRCON_VBOOT
#define CONFIG_LIBAVB
#define CONFIG_USE_ROLLBACK_IN_FUSE
#define CONFIG_WDT
#define CONFIG_USB_GADGET
#define CONFIG_CMD_FASTBOOT
#define CONFIG_SYS_CACHELINE_SIZE 64
#define CONFIG_FASTBOOT_FLASH_NAND_DEV
#define CONFIG_FASTBOOT_FLASH
#define CONFIG_DEVICE_PRODUCT "Google Home Hub"
/* Timeout of 0 will only check any buffered keys, but will then continue
immediately. This turns out to be sufficient for us, since a user can hit
the fastboot key any time prior to this during boot and we'll still see it
when flushing the buffer. */
#define CONFIG_FORCE_FASTBOOT_TIMEOUT_MS 0
#define CONFIG_G_DNL_MANUFACTURER "Google"
#define CONFIG_G_DNL_VENDOR_NUM 0x18d1
#define CONFIG_G_DNL_PRODUCT_NUM 0x4ee0
/* DRAM Layout
* 0x00000000 -----------------------------------------
* RSV (16 MiB) (Usable by kernel)
* 0x01000000 -----------------------------------------
* Device Tree (512 KiB) (Unused)
* 0x01080000 -----------------------------------------
* Default Kernel Location (63.5 MiB)
* 0x05000000 -----------------------------------------
* BL31/32 Reserved (35 MiB)
* 0x07300000 -----------------------------------------
* LastKmsg (Unused)
* 0x07400000 -----------------------------------------
* Fastboot Buffer Location (512 MiB)
* 0x27400000 -----------------------------------------
* Unused (512 MiB)
* 0x47400000 -----------------------------------------
* U-Boot Code + Stack + Heap (268 MiB)
* 0x58000000 -----------------------------------------
* RSV (128 MiB)
* - board cfg file?
* 0x5f7fe000 - 0x5f800000 (8 KiB)
* - NVRAM region
* 0x5f800000 - 0x60000000 (8 MiB)
* - marked as reserved to zircon
* 0x60000000 -----------------------------------------
*/
#define CONFIG_DEFAULT_KERNEL_ADDR 0x01080000
#define CONFIG_DEFAULT_KERNEL_SIZE 0x03f80000
#define CONFIG_USB_FASTBOOT_BUF_ADDR 0x07400000
#define CONFIG_USB_FASTBOOT_BUF_SIZE 0x20000000
/*
* platform power init config
*/
#define CONFIG_PLATFORM_POWER_INIT
#define CONFIG_VCCK_INIT_VOLTAGE 800 // VCCK power up voltage
#define CONFIG_VDDEE_INIT_VOLTAGE 840 // VDDEE power up voltage
#define CONFIG_VDDEE_SLEEP_VOLTAGE 731 // VDDEE suspend voltage
/* SMP Definitinos */
#define CPU_RELEASE_ADDR secondary_boot_func
/* Bootloader Control Block function
That is used for recovery and the bootloader to talk to each other
*/
#define CONFIG_BOOTLOADER_CONTROL_BLOCK
/* Serial config */
#define CONFIG_CONS_INDEX 2
#define CONFIG_BAUDRATE 115200
#define CONFIG_AML_MESON_SERIAL 1
#define CONFIG_SERIAL_MULTI 1
//Enable ir remote wake up for bl30
#define CONFIG_IR_REMOTE_POWER_UP_KEY_VAL1 0xef10fe01 //amlogic tv ir --- power
#define CONFIG_IR_REMOTE_POWER_UP_KEY_VAL2 0XBB44FB04 //amlogic tv ir --- ch+
#define CONFIG_IR_REMOTE_POWER_UP_KEY_VAL3 0xF20DFE01 //amlogic tv ir --- ch-
#define CONFIG_IR_REMOTE_POWER_UP_KEY_VAL4 0xFFFFFFFF
#define CONFIG_IR_REMOTE_POWER_UP_KEY_VAL5 0xe51afb04
#define CONFIG_IR_REMOTE_POWER_UP_KEY_VAL6 0xFFFFFFFF
#define CONFIG_IR_REMOTE_POWER_UP_KEY_VAL7 0xFFFFFFFF
#define CONFIG_IR_REMOTE_POWER_UP_KEY_VAL8 0xFFFFFFFF
#define CONFIG_IR_REMOTE_POWER_UP_KEY_VAL9 0xFFFFFFFF
/*config the default parameters for adc power key*/
#define CONFIG_ADC_POWER_KEY_CHAN 2 /*channel range: 0-7*/
#define CONFIG_ADC_POWER_KEY_VAL 0 /*sample value range: 0-1023*/
/* args/envs */
#define CONFIG_SYS_MAXARGS 64
#define CONFIG_EXTRA_ENV_SETTINGS \
"loadaddr="__stringify(CONFIG_DEFAULT_KERNEL_ADDR)"\0" \
"loadsize="__stringify(CONFIG_DEFAULT_KERNEL_SIZE)"\0" \
"outputmode=panel\0" \
"hdmimode=1080p60hz\0" \
"display_width=1920\0" \
"display_height=1080\0" \
"display_bpp=16\0" \
"display_color_index=16\0" \
"display_layer=osd0\0" \
"display_color_fg=0xffff\0" \
"display_color_bg=0\0" \
"dtb_mem_addr=0x1000000\0" \
"fb_addr=0x5f800000\0" \
"fb_width=608\0" \
"fb_height=1024\0" \
"usb_burning=update 1000\0" \
"fdt_high=0x20000000\0" \
"try_auto_burn=update 700 750;\0" \
"sdcburncfg=aml_sdc_burn.ini\0" \
"sdc_burning=sdc_burn ${sdcburncfg}\0" \
"wipe_data=successful\0" \
"wipe_cache=successful\0" \
"EnableSelinux=enforcing\0" \
"storeargs=" \
"get_rebootmode;" \
"setenv bootargs " \
"logo=${display_layer},loaded,${fb_addr} " \
"vout=${outputmode},enable " \
"panel_type=${panel_type} " \
"test_mode=${test_mode} " \
"androidboot.reboot_mode=${reboot_mode} " \
"ramoops.mem_address=0x20000000 ramoops.mem_size=0x100000 ramoops.record_size=0x8000 ramoops.console_size=0x8000 " \
"hw_id=${hw_id};" \
"setenv bootargs ${bootargs} " \
"androidboot.hardware="__stringify(BOARD_NAME)";" \
"\0" \
"switch_bootmode=" \
"get_rebootmode;" \
"if test ${reboot_mode} = factory_reset; then " \
"run recovery_from_flash;" \
"else if test ${reboot_mode} = update; then " \
"run update;" \
"else if test ${reboot_mode} = cold_boot; then " \
/* "run try_auto_burn;" */ \
"else if test ${reboot_mode} = fastboot; then " \
"fastboot;" \
"fi;fi;fi;fi;" \
"\0" \
"storeboot=" \
/* zvb_load_and_boot doesn't return on success */ \
"zvb_load_and_boot kernel ${loadaddr} ${loadsize};" \
"run update;" \
"\0" \
"factory_reset_poweroff_protect=" \
"echo wipe_data=${wipe_data};" \
"echo wipe_cache=${wipe_cache};" \
"if test ${wipe_data} = failed; then " \
"run init_display;" \
"run get_hw_id;" \
"run storeargs;" \
"run recovery_from_flash;" \
"fi;" \
"if test ${wipe_cache} = failed; then " \
"run init_display;" \
"run get_hw_id;" \
"run storeargs;" \
"run recovery_from_flash;" \
"fi;" \
"\0" \
"update=" \
"run usb_burning;" \
"run recovery_from_flash;" \
"\0" \
/* load and boot an image from 'recovery' partition to restore the device. */ \
"recovery_from_flash=" \
"zvb_load_and_boot recovery ${loadaddr} ${loadsize};" \
"\0" \
"reset_ddic=" \
"gpio clear GPIOH_6" \
"\0" \
"detect_panel=" \
"if gpio input GPIOH_5; then " \
"setenv panel_type lcd_3;" \
"else " \
"setenv panel_type lcd_4;" \
"fi;" \
"\0" \
"start_backlight=" \
"if ubifsload 0x8000000 bl_calibration.txt 0x100000; then " \
"configure_backlight 0x8000000;" \
"else " \
"configure_backlight;" \
"fi;" \
"\0"\
"init_display=" \
"run reset_ddic;" \
"check_fdr_for_backlight_brightness;" \
"run detect_panel;" \
"osd open;" \
"osd clear;" \
"osd setcolor 0x5b0d5b0d;" \
"ubi part factory;" \
"ubifsmount ubi0:factory;" \
/* do this sequentially so we could reuse the address and do
* not need to know the size of the images */ \
"mw 0x8000000 0 1;" \
"ubifsload 0x8000000 logo.bmp 0x100000;" \
"bmp display 0x8000000;" \
"mw 0x8000000 0 1;" \
"ubifsload 0x8000000 corner_BL.bmp 0x100000;" \
"bmp display 0x8000000 0 1008;" \
"mw 0x8000000 0 1;" \
"ubifsload 0x8000000 corner_BR.bmp 0x100000;" \
"bmp display 0x8000000 592 1008;" \
"mw 0x8000000 0 1;" \
"ubifsload 0x8000000 corner_TL.bmp 0x100000;" \
"bmp display 0x8000000 0 0;" \
"mw 0x8000000 0 1;" \
"ubifsload 0x8000000 corner_TR.bmp 0x100000;" \
"bmp display 0x8000000 592 0;" \
"bmp scale;" \
"vout output ${outputmode};" \
"run start_backlight;" \
"ubifsumount;" \
"\0" \
"get_hw_id=" \
"get_estelle_hw_id;" \
"\0" \
"upgrade_key=" \
"setenv boot_external_image 0;" \
"if gpio input GPIOZ_6; then " \
"echo detect VOL_DN pressed;" \
"run recovery_from_flash;" \
"else " \
"if gpio input GPIOZ_5; then " \
"echo detect VOL_UP pressed;" \
"if gpio input GPIOZ_2; then " \
"echo MUTE not engaged, starting fastboot;" \
/* If we don't detect a host USB
connection, exit fastboot mode and
boot normally.*/ \
"fastboot_if_host_connected;" \
"else " \
"echo MUTE engaged, skipping fastboot;" \
"fi;" \
"else " \
"echo upgrade key not pressed;" \
"fi;" \
"fi;" \
"if force_fastboot_mode; then " \
"echo fastboot mode was requested;" \
"fastboot;" \
"fi;" \
"\0" \
#define CONFIG_PREBOOT \
"run factory_reset_poweroff_protect;" \
"run init_display;" \
"run get_hw_id;" \
"run storeargs;" \
"run upgrade_key;" \
"run switch_bootmode;"
#define CONFIG_BOOTCOMMAND "run storeboot;"
#define CONFIG_ENV_IS_NOWHERE 1
#define CONFIG_SHORT_RSV 1
#define RESERVED_BLOCK_NUM 8
#define CONFIG_ENV_SIZE (64*1024)
#define CONFIG_FIT 1
#define CONFIG_OF_LIBFDT 1
#define CONFIG_ANDROID_BOOT_IMAGE 1
#define CONFIG_ANDROID_IMG 1
#define CONFIG_SYS_BOOTM_LEN (64<<20) /* Increase max gunzip size*/
/* cpu */
#define CONFIG_CPU_CLK 1200 //MHz. Range: 360-2000, should be multiple of 24
/* ATTENTION */
/* DDR configs move to board/amlogic/[board]/firmware/timing.c */
#define CONFIG_NR_DRAM_BANKS 1
/* ddr functions */
#define CONFIG_DDR_FULL_TEST 0 //0:disable, 1:enable. ddr full test
#define CONFIG_CMD_DDR_D2PLL 0 //0:disable, 1:enable. d2pll cmd
#define CONFIG_CMD_DDR_TEST 0 //0:disable, 1:enable. ddrtest cmd
#define CONFIG_DDR_LOW_POWER 0 //0:disable, 1:enable. ddr clk gate for lp
#define CONFIG_DDR_ZQ_PD 0 //0:disable, 1:enable. ddr zq power down
#define CONFIG_DDR_USE_EXT_VREF 0 //0:disable, 1:enable. ddr use external vref
#define CONFIG_DDR4_TIMING_TEST 0 //0:disable, 1:enable. ddr4 timing test function
#define CONFIG_DDR_PLL_BYPASS 0 //0:disable, 1:enable. ddr pll bypass function
/* storage: emmc/nand/sd */
#define CONFIG_STORE_COMPATIBLE 1
#define CONFIG_ENV_OVERWRITE
#define CONFIG_CMD_SAVEENV
/* fixme, need fix*/
#if (defined(CONFIG_ENV_IS_IN_AMLNAND) || defined(CONFIG_ENV_IS_IN_MMC)) && defined(CONFIG_STORE_COMPATIBLE)
#error env in amlnand/mmc already be compatible;
#endif
/*
* storage
* |---------|---------|
* | |
* emmc<--Compatible-->nand
* |-------|-------|
* | |
* MTD<-Exclusive->NFTL
*/
/* axg only support slc nand */
/* swither for mtd nand which is for slc only. */
/* support for mtd */
#define CONFIG_AML_MTD 1
/* support for nftl */
//#define CONFIG_AML_NAND 1
#define CONFIG_NOT_SKIP_BAD_BLOCK 1
/* support nand fts*/
#define CONFIG_NAND_FTS 1
#if defined(CONFIG_AML_NAND) && defined(CONFIG_AML_MTD)
#error CONFIG_AML_NAND/CONFIG_AML_MTD can not support at the sametime;
#endif
#ifdef CONFIG_AML_MTD
/* bootlaoder is construct by bl2 and fip
* when DISCRETE_BOOTLOADER is enabled, bl2 & fip
* will not be stored continuously, and nand layout
* would be bl2|rsv|fip|normal, but not
* bl2|fip|rsv|noraml anymore
*/
#define CONFIG_DISCRETE_BOOTLOADER
#ifdef CONFIG_DISCRETE_BOOTLOADER
#define CONFIG_TPL_SIZE_PER_COPY 0x200000
#define CONFIG_TPL_COPY_NUM 4
#define CONFIG_TPL_PART_NAME "tpl"
/* for bl2, restricted by romboot */
#define CONFIG_BL2_COPY_NUM 8
#endif /* CONFIG_DISCRETE_BOOTLOADER */
#define CONFIG_CMD_NAND 1
#define CONFIG_MTD_DEVICE y
/* mtd parts of ourown.*/
#define CONFIFG_AML_MTDPART 1
/* mtd parts by env default way.*/
/*
#define MTDIDS_NAME_STR "aml_nand.0"
#define MTDIDS_DEFAULT "nand1=" MTDIDS_NAME_STR
#define MTDPARTS_DEFAULT "mtdparts=" MTDIDS_NAME_STR ":" \
"3M@8192K(logo)," \
"10M(recovery)," \
"8M(kernel)," \
"40M(rootfs)," \
"-(data)"
*/
#define CONFIG_CMD_UBI
#define CONFIG_CMD_UBIFS
#define CONFIG_RBTREE
#define CONFIG_CMD_NAND_TORTURE 1
#define CONFIG_CMD_MTDPARTS 1
#define CONFIG_MTD_PARTITIONS 1
#define CONFIG_SYS_MAX_NAND_DEVICE 2
#define CONFIG_SYS_NAND_BASE_LIST {0}
#endif
/* endof CONFIG_AML_MTD */
#define CONFIG_AML_SD_EMMC 1
#ifdef CONFIG_AML_SD_EMMC
#define CONFIG_GENERIC_MMC 1
#define CONFIG_CMD_MMC 1
#define CONFIG_CMD_GPT 1
#define CONFIG_SYS_MMC_ENV_DEV 1
#define CONFIG_EMMC_DDR52_EN 0
#define CONFIG_EMMC_DDR52_CLK 35000000
#endif
#define CONFIG_PARTITIONS 1
#define CONFIG_SYS_NO_FLASH 1
#if defined CONFIG_AML_MTD || defined CONFIG_SPI_NAND
#define CONFIG_CMD_NAND 1
#define CONFIG_MTD_DEVICE y
#define CONFIG_RBTREE
#define CONFIG_CMD_NAND_TORTURE 1
#define CONFIG_CMD_MTDPARTS 1
#define CONFIG_MTD_PARTITIONS 1
#define CONFIG_SYS_MAX_NAND_DEVICE 2
#define CONFIG_SYS_NAND_BASE_LIST {0}
#endif
/* vpu */
#define CONFIG_AML_VPU 1
//#define CONFIG_VPU_CLK_LEVEL_DFT 7
/* DISPLAY & HDMITX */
#define CONFIG_AML_CANVAS 1 // required for showing the logo during uboot
#define CONFIG_AML_VOUT 1
#define CONFIG_AML_OSD 1
#define CONFIG_OSD_SCALE_ENABLE 1
#define CONFIG_CMD_BMP 1
#define CONFIG_AML_LCD 1
#define CONFIG_AML_LCD_TABLET 1
#define CONFIG_AML_LCD_EXTERN 1
#define CONFIG_AML_LCD_EXTERN_MIPI_TV070WSM 1
#define CONFIG_AML_LCD_EXTERN_MIPI_P070ACB 1
#define CONFIG_AML_LCD_EXTERN_MIPI_TV070WSM_FT 1
#define CONFIG_AML_LCD_EXTERN_MIPI_P070ACB_FT 1
/* USB
* Enable CONFIG_MUSB_HCD for Host functionalities MSC, keyboard
* Enable CONFIG_MUSB_UDD for Device functionalities.
*/
/* #define CONFIG_MUSB_UDC 1 */
#define CONFIG_CMD_USB 1
#if defined(CONFIG_CMD_USB)
#define CONFIG_GXL_XHCI_BASE 0xff500000
#define CONFIG_GXL_USB_PHY2_BASE 0xffe09000
#define CONFIG_GXL_USB_PHY3_BASE 0xffe09080
#define CONFIG_USB_PHY_20 0xff636000
#define CONFIG_USB_PHY_21 0xff63A000
#define CONFIG_USB_STORAGE 1
#define CONFIG_USB_XHCI 1
#define CONFIG_USB_XHCI_AMLOGIC_V2 1
#define CONFIG_USB_GPIO_PWR GPIOEE(GPIOH_6)
#define CONFIG_USB_GPIO_PWR_NAME "GPIOH_6"
//#define CONFIG_USB_XHCI_AMLOGIC_USB3_V2 1
#endif //#if defined(CONFIG_CMD_USB)
#define CONFIG_TXLX_USB 1
#define CONFIG_USB_DEVICE_V2 1
#define USB_PHY2_PLL_PARAMETER_1 0x09400414
#define USB_PHY2_PLL_PARAMETER_2 0x927e0000
#define USB_PHY2_PLL_PARAMETER_3 0xAC5F49E5
//UBOOT Facotry usb/sdcard burning config
#ifndef CONFIG_AML_DISABLE_UPDATE_MODE
#define CONFIG_AML_V2_FACTORY_BURN 1 //support facotry usb burning
#endif
#define CONFIG_AML_FACTORY_BURN_LOCAL_UPGRADE 1 //support factory sdcard burning
#define CONFIG_POWER_KEY_NOT_SUPPORTED_FOR_BURN 1 //There isn't power-key for factory sdcard burning
#define CONFIG_SD_BURNING_SUPPORT_UI 1 //Displaying upgrading progress bar when sdcard/udisk burning
#define CONFIG_AML_SECURITY_KEY 1
#define CONFIG_UNIFY_KEY_MANAGE 1
/* other devices */
#define CONFIG_EFUSE 1
#define CONFIG_SYS_I2C_AML 1
#define CONFIG_SYS_I2C_AML_HAS_MASK 1
#define CONFIG_SYS_I2C_SPEED 400000
#define CONFIG_I2C_MULTI_BUS 1
/* commands */
#define CONFIG_CMD_CACHE 1
#define CONFIG_CMD_BOOTI 1
#define CONFIG_CMD_EFUSE 1
#define CONFIG_CMD_I2C 1
#define CONFIG_CMD_MEMORY 1
#define CONFIG_CMD_FAT 1
#define CONFIG_CMD_GPIO 1
#define CONFIG_CMD_RUN
#define CONFIG_CMD_REBOOT 1
#define CONFIG_CMD_FACTORY_BOOT 1
#define CONFIG_CMD_ECHO 1
#define CONFIG_CMD_AUTOSCRIPT 1
#define CONFIG_CMD_MISC 1
/*file system*/
#define CONFIG_DOS_PARTITION 1
#define CONFIG_EFI_PARTITION 1
#define CONFIG_AML_PARTITION 1
#define CONFIG_MMC 1
#define CONFIG_FS_FAT 1
#define CONFIG_FS_EXT4 1
#define CONFIG_LZO 1
/* Cache Definitions */
//#define CONFIG_SYS_DCACHE_OFF
//#define CONFIG_SYS_ICACHE_OFF
/* other functions */
#define CONFIG_NEED_BL301 1
#define CONFIG_NEED_BL32 1
#define CONFIG_FIP_IMG_SUPPORT 1
#define CONFIG_BOOTDELAY -2 // autoboot with no delay and not check for abort
#define CONFIG_SYS_LONGHELP 1
#define CONFIG_CMD_MISC 1
#define CONFIG_CMD_ITEST 1
#define CONFIG_CMD_CPU_TEMP 1
#define CONFIG_SYS_MEM_TOP_HIDE 0x08000000 //hide 128MB for kernel reserve
#define CONFIG_CMD_LOADB 1
//#define CONFIG_MULTI_DTB 1
/* debug mode defines */
//#define CONFIG_DEBUG_MODE 1
#ifdef CONFIG_DEBUG_MODE
#define CONFIG_DDR_CLK_DEBUG 636
#define CONFIG_CPU_CLK_DEBUG 600
#endif
//support secure boot
#define CONFIG_AML_SECURE_UBOOT 1
#if defined(CONFIG_AML_SECURE_UBOOT)
//for SRAM size limitation just disable NAND
//as the socket board default has no NAND
//#undef CONFIG_AML_NAND
//unify build for generate encrypted bootloader "u-boot.bin.encrypt"
#define CONFIG_AML_CRYPTO_UBOOT 1
//unify build for generate encrypted kernel image
//SRC : "board/amlogic/(board)/boot.img"
//DST : "fip/boot.img.encrypt"
//#define CONFIG_AML_CRYPTO_IMG 1
#endif //CONFIG_AML_SECURE_UBOOT
#define CONFIG_SECURE_STORAGE 1
// Check size of boot image before load. See doc:
// https://docs.google.com/document/d/1YrW2yBzCbMrQfBR2n56aUPZPg_0waxveOH-E0NU07OM/edit?usp=sharing
#define CONFIG_IMG_SECURE_CHECK_SZ 0x3f00000
//build with uboot auto test
//#define CONFIG_AML_UBOOT_AUTO_TEST 1
//board customer ID
//#define CONFIG_CUSTOMER_ID (0x6472616F624C4D41)
#if defined(CONFIG_CUSTOMER_ID)
#undef CONFIG_AML_CUSTOMER_ID
#define CONFIG_AML_CUSTOMER_ID CONFIG_CUSTOMER_ID
#endif
#endif