1 /* 2 * (C) Copyright 2024 Rockchip Electronics Co., Ltd 3 * 4 * SPDX-License-Identifier: GPL-2.0+ 5 */ 6 7 #ifndef __CONFIG_RV1103B_COMMON_H 8 #define __CONFIG_RV1103B_COMMON_H 9 10 #include "rockchip-common.h" 11 12 #define COUNTER_FREQUENCY 24000000 13 #define CONFIG_SYS_MALLOC_LEN (16 << 20) 14 #define CONFIG_SYS_CBSIZE 1024 15 #define CONFIG_SYS_NS16550_MEM32 16 17 #define CONFIG_SYS_TEXT_BASE 0x00200000 18 #define CONFIG_SYS_INIT_SP_ADDR 0x00400000 19 #define CONFIG_SYS_LOAD_ADDR 0x00008000 20 #define CONFIG_SYS_BOOTM_LEN (64 << 20) 21 #define CONFIG_SYS_SDRAM_BASE 0 22 #define SDRAM_MAX_SIZE 0x80000000 23 #define CONFIG_SYS_NONCACHED_MEMORY (1 << 20) /* 1 MiB */ 24 25 /* SPL */ 26 #define CONFIG_SPL_FRAMEWORK 27 #define CONFIG_SPL_TEXT_BASE 0x00000000 28 #define CONFIG_SPL_MAX_SIZE 0x40000 29 #define CONFIG_SPL_BSS_START_ADDR 0x001fe000 30 #define CONFIG_SPL_BSS_MAX_SIZE 0x20000 31 #define CONFIG_SPL_STACK 0x001fe000 32 33 /* secure otp */ 34 #define OTP_UBOOT_ROLLBACK_OFFSET 0x350 35 #define OTP_UBOOT_ROLLBACK_WORDS 2 /* 64 bits, 2 words */ 36 #define OTP_ALL_ONES_NUM_BITS 32 37 #define OTP_SECURE_BOOT_ENABLE_ADDR 0x20 38 #define OTP_SECURE_BOOT_ENABLE_SIZE 1 39 #define OTP_RSA_HASH_ADDR 0x180 40 #define OTP_RSA_HASH_SIZE 32 41 42 /* MMC/SD IP block */ 43 #define CONFIG_BOUNCE_BUFFER 44 45 #ifndef CONFIG_SPL_BUILD 46 /* usb mass storage */ 47 #define CONFIG_USB_FUNCTION_MASS_STORAGE 48 #define CONFIG_ROCKUSB_G_DNL_PID 0x110e 49 50 #define CONFIG_LIB_HW_RAND 51 #define CONFIG_PREBOOT 52 53 #ifdef CONFIG_ENV_MEM_LAYOUT 54 #define ENV_MEM_LAYOUT_SETTINGS CONFIG_ENV_MEM_LAYOUT_SETTINGS 55 #else 56 /* 57 * Image: 0 - 8M 58 * zImage: 8 - 12M 59 * fdt: 12 - 13M 60 * ramdisk: 14 ... 61 */ 62 #define ENV_MEM_LAYOUT_SETTINGS \ 63 "scriptaddr=0x00b00000\0" \ 64 "pxefile_addr_r=0x00c00000\0" \ 65 "fdt_addr_r=0x00c00000\0" \ 66 "kernel_addr_c=0x00808000\0" \ 67 "kernel_addr_r=0x00008000\0" \ 68 "ramdisk_addr_r=0x000e00000\0" 69 #endif 70 71 #define CONFIG_EXTRA_ENV_SETTINGS \ 72 ENV_MEM_LAYOUT_SETTINGS \ 73 ROCKCHIP_DEVICE_SETTINGS \ 74 RKIMG_DET_BOOTDEV 75 76 #undef RKIMG_BOOTCOMMAND 77 #ifdef CONFIG_FIT_SIGNATURE 78 #define RKIMG_BOOTCOMMAND \ 79 "boot_fit;" 80 #else 81 #define RKIMG_BOOTCOMMAND \ 82 "boot_fit;" \ 83 "boot_android ${devtype} ${devnum};" 84 #endif 85 86 /* Update define for tiny image */ 87 #ifdef CONFIG_ROCKCHIP_IMAGE_TINY 88 #undef RKIMG_BOOTCOMMAND 89 #undef RKIMG_DET_BOOTDEV 90 #undef CONFIG_EXTRA_ENV_SETTINGS 91 #undef CONFIG_AUTO_COMPLETE 92 #undef CONFIG_SYS_LONGHELP 93 #undef CONFIG_ZLIB 94 #undef CONFIG_GZIP 95 /* TODO: #define CONFIG_LIB_HW_RAND */ 96 97 #define RKIMG_BOOTCOMMAND "boot_fit;" 98 #define CONFIG_EXTRA_ENV_SETTINGS ENV_MEM_LAYOUT_SETTINGS 99 #endif 100 #endif /* !CONFIG_SPL_BUILD */ 101 102 #endif 103