]>
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> | |
09140113 | 8 | #include <env.h> |
5255932f | 9 | #include <init.h> |
47b4c228 | 10 | #include <asm/io.h> |
15f09a1a KY |
11 | #include <asm/arch-rockchip/uart.h> |
12 | #include <asm/arch-rockchip/sdram_rk3036.h> | |
e68f2036 | 13 | #include <asm/gpio.h> |
47b4c228 | 14 | |
47b4c228 | 15 | void get_ddr_config(struct rk3036_ddr_config *config) |
16 | { | |
17 | /* K4B4G1646Q config */ | |
18 | config->ddr_type = 3; | |
19 | config->rank = 1; | |
20 | config->cs0_row = 15; | |
21 | config->cs1_row = 15; | |
22 | ||
23 | /* 8bank */ | |
24 | config->bank = 3; | |
25 | config->col = 10; | |
26 | ||
27 | /* 16bit bw */ | |
28 | config->bw = 1; | |
29 | } | |
30 | ||
e68f2036 JC |
31 | #define FASTBOOT_KEY_GPIO 93 |
32 | ||
33 | int fastboot_key_pressed(void) | |
34 | { | |
35 | gpio_request(FASTBOOT_KEY_GPIO, "fastboot_key"); | |
36 | gpio_direction_input(FASTBOOT_KEY_GPIO); | |
37 | return !gpio_get_value(FASTBOOT_KEY_GPIO); | |
38 | } | |
39 | ||
40 | #define ROCKCHIP_BOOT_MODE_FASTBOOT 0x5242C309 | |
41 | ||
67171e13 | 42 | int rk_board_late_init(void) |
e68f2036 | 43 | { |
67171e13 | 44 | if (fastboot_key_pressed()) { |
e68f2036 | 45 | printf("enter fastboot!\n"); |
382bee57 | 46 | env_set("preboot", "setenv preboot; fastboot usb0"); |
e68f2036 JC |
47 | } |
48 | ||
49 | return 0; | |
50 | } |