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 0x00400000 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 0x03fe0000 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 49 #ifndef CONFIG_SPL_BUILD 50 /* usb mass storage */ 51 #define CONFIG_USB_FUNCTION_MASS_STORAGE 52 #define CONFIG_ROCKUSB_G_DNL_PID 0x350f 53 54 #define CONFIG_LIB_HW_RAND 55 #define CONFIG_PREBOOT 56 57 /* 58 * fdt: 396K - 524K 59 * Image: 1M+32k - 16M 60 * zImage: 16M - 24M 61 * ramdisk: 24M - ... 62 */ 63 #define ENV_MEM_LAYOUT_SETTINGS \ 64 "scriptaddr=0x00b00000\0" \ 65 "pxefile_addr_r=0x00c00000\0" \ 66 "fdt_addr_r=0x00063000\0" \ 67 "kernel_addr_r=0x00108000\0" \ 68 "kernel_addr_c=0x01100000\0" \ 69 "ramdisk_addr_r=0x01800000\0" 70 71 #include <config_distro_bootcmd.h> 72 73 #define CONFIG_EXTRA_ENV_SETTINGS \ 74 ENV_MEM_LAYOUT_SETTINGS \ 75 "partitions=" PARTS_RKIMG \ 76 ROCKCHIP_DEVICE_SETTINGS \ 77 RKIMG_DET_BOOTDEV \ 78 BOOTENV 79 80 #undef RKIMG_BOOTCOMMAND 81 #ifdef CONFIG_FIT_SIGNATURE 82 #define RKIMG_BOOTCOMMAND \ 83 "boot_fit;" 84 #else 85 #define RKIMG_BOOTCOMMAND \ 86 "boot_fit;" \ 87 "boot_android ${devtype} ${devnum};" 88 #endif 89 90 #endif 91 #endif 92