1 /* SPDX-License-Identifier: GPL-2.0+ */ 2 /* 3 * (C) Copyright 2024 Rockchip Electronics Co., Ltd 4 * 5 */ 6 7 #ifndef __CONFIG_RK3506_COMMON_H 8 #define __CONFIG_RK3506_COMMON_H 9 10 #define CFG_CPUID_OFFSET 0xa 11 12 #include "rockchip-common.h" 13 14 #define COUNTER_FREQUENCY 24000000 15 #define CONFIG_SYS_MALLOC_LEN (16 << 20) 16 #define CONFIG_SYS_CBSIZE 1024 17 #define CONFIG_SYS_TEXT_BASE 0x00200000 18 #define CONFIG_SYS_INIT_SP_ADDR 0x00600000 19 #define CONFIG_SYS_LOAD_ADDR 0x00008000 20 #define CONFIG_SYS_BOOTM_LEN (64 << 20) /* 64M */ 21 #define CONFIG_SYS_SDRAM_BASE 0 22 #define SDRAM_MAX_SIZE 0xc0000000 23 #define CONFIG_SYS_NONCACHED_MEMORY (1 << 20) /* 1 MiB */ 24 25 /* SPL */ 26 #define CONFIG_SPL_FRAMEWORK 27 #define CONFIG_SPL_TEXT_BASE 0x03f00000 28 #define CONFIG_SPL_MAX_SIZE 0x40000 29 #define CONFIG_SPL_BSS_START_ADDR 0x03fe0000 30 #define CONFIG_SPL_BSS_MAX_SIZE 0x20000 31 #define CONFIG_SPL_STACK 0x03f00000 32 33 #define GICD_BASE 0xff581000 34 #define GICC_BASE 0xff582000 35 36 #define ATAGS_OFFSET 0x62000 37 #define ATAGS_SIZE 0x01000 38 39 /* secure otp */ 40 #define OTP_UBOOT_ROLLBACK_OFFSET 0x350 41 #define OTP_UBOOT_ROLLBACK_WORDS 2 /* 64 bits, 2 words */ 42 #define OTP_ALL_ONES_NUM_BITS 32 43 #define OTP_SECURE_BOOT_ENABLE_ADDR 0x20 44 #define OTP_SECURE_BOOT_ENABLE_SIZE 1 45 #define OTP_RSA_HASH_ADDR 0x180 46 #define OTP_RSA_HASH_SIZE 32 47 48 /* MMC/SD IP block */ 49 #define CONFIG_BOUNCE_BUFFER 50 #define CONFIG_PRAM 6144 51 52 #ifndef CONFIG_SPL_BUILD 53 /* usb mass storage */ 54 #define CONFIG_USB_FUNCTION_MASS_STORAGE 55 #define CONFIG_ROCKUSB_G_DNL_PID 0x350f 56 57 #define CONFIG_LIB_HW_RAND 58 #define CONFIG_PREBOOT 59 60 /* 61 * fdt: 396K - 524K 62 * Image: 1M+32k - 16M 63 * zImage: 16M - 24M 64 * ramdisk: 24M - ... 65 */ 66 #define ENV_MEM_LAYOUT_SETTINGS \ 67 "scriptaddr=0x00b00000\0" \ 68 "pxefile_addr_r=0x00c00000\0" \ 69 "fdt_addr_r=0x00063000\0" \ 70 "kernel_addr_r=0x00108000\0" \ 71 "kernel_addr_c=0x01100000\0" \ 72 "ramdisk_addr_r=0x01800000\0" 73 74 #include <config_distro_bootcmd.h> 75 76 #define CONFIG_EXTRA_ENV_SETTINGS \ 77 ENV_MEM_LAYOUT_SETTINGS \ 78 "partitions=" PARTS_RKIMG \ 79 ROCKCHIP_DEVICE_SETTINGS \ 80 RKIMG_DET_BOOTDEV \ 81 BOOTENV 82 83 #undef RKIMG_BOOTCOMMAND 84 #ifdef CONFIG_FIT_SIGNATURE 85 #define RKIMG_BOOTCOMMAND \ 86 "boot_fit;" 87 #else 88 #define RKIMG_BOOTCOMMAND \ 89 "boot_fit;" \ 90 "boot_android ${devtype} ${devnum};" 91 #endif 92 93 #endif 94 #endif 95