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