]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
47b4c228 | 2 | /* |
3 | * (C) Copyright 2015 Rockchip Electronics Co., Ltd | |
47b4c228 | 4 | */ |
5 | ||
6 | #include <common.h> | |
7 | #include <dm.h> | |
8 | #include <asm/io.h> | |
9 | #include <asm/arch/uart.h> | |
10 | #include <asm/arch/sdram_rk3036.h> | |
e68f2036 | 11 | #include <asm/gpio.h> |
47b4c228 | 12 | |
47b4c228 | 13 | void get_ddr_config(struct rk3036_ddr_config *config) |
14 | { | |
15 | /* K4B4G1646Q config */ | |
16 | config->ddr_type = 3; | |
17 | config->rank = 1; | |
18 | config->cs0_row = 15; | |
19 | config->cs1_row = 15; | |
20 | ||
21 | /* 8bank */ | |
22 | config->bank = 3; | |
23 | config->col = 10; | |
24 | ||
25 | /* 16bit bw */ | |
26 | config->bw = 1; | |
27 | } | |
28 | ||
e68f2036 JC |
29 | #define FASTBOOT_KEY_GPIO 93 |
30 | ||
31 | int fastboot_key_pressed(void) | |
32 | { | |
33 | gpio_request(FASTBOOT_KEY_GPIO, "fastboot_key"); | |
34 | gpio_direction_input(FASTBOOT_KEY_GPIO); | |
35 | return !gpio_get_value(FASTBOOT_KEY_GPIO); | |
36 | } | |
37 | ||
38 | #define ROCKCHIP_BOOT_MODE_FASTBOOT 0x5242C309 | |
39 | ||
67171e13 | 40 | int rk_board_late_init(void) |
e68f2036 | 41 | { |
67171e13 | 42 | if (fastboot_key_pressed()) { |
e68f2036 | 43 | printf("enter fastboot!\n"); |
382bee57 | 44 | env_set("preboot", "setenv preboot; fastboot usb0"); |
e68f2036 JC |
45 | } |
46 | ||
47 | return 0; | |
48 | } |