blob: 4b67a4ba2dde57828686a3d172b5990624797ffa [file] [log] [blame]
Luka Kovacic22bb9132019-05-07 19:35:55 +02001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2015 Stefan Roese <sr@denx.de>
4 */
5
6#include <common.h>
7#include <i2c.h>
Simon Glass691d7192020-05-10 11:40:02 -06008#include <init.h>
Luka Kovacic22bb9132019-05-07 19:35:55 +02009#include <asm/gpio.h>
10#include <linux/mbus.h>
11#include <linux/io.h>
12#include <asm/arch/cpu.h>
13#include <asm/arch/soc.h>
14
15DECLARE_GLOBAL_DATA_PTR;
16
17/*
18 * These values and defines are taken from the Marvell U-Boot version
19 * "u-boot-2013.01-2016_T1.0.eng_drop_v6"
20 */
21#define DB_DX_AC3_GPP_OUT_ENA_LOW (~(BIT(0) | BIT(2) | BIT(3) | BIT(4) \
22 | BIT(6) | BIT(12) | BIT(13) \
23 | BIT(16) | BIT(17) | BIT(20) \
24 | BIT(29) | BIT(30)))
25#define DB_DX_AC3_GPP_OUT_ENA_MID (~(0))
26#define DB_DX_AC3_GPP_OUT_VAL_LOW (BIT(0) | BIT(2) | BIT(3) | BIT(4) \
27 | BIT(6) | BIT(12) | BIT(13) \
28 | BIT(16) | BIT(17) | BIT(20) \
29 | BIT(29) | BIT(30))
30#define DB_DX_AC3_GPP_OUT_VAL_MID 0x0
31#define DB_DX_AC3_GPP_POL_LOW 0x0
32#define DB_DX_AC3_GPP_POL_MID 0x0
33
34int board_early_init_f(void)
35{
36 /* Configure MPP */
37 writel(0x00142222, MVEBU_MPP_BASE + 0x00);
38 writel(0x11122000, MVEBU_MPP_BASE + 0x04);
39 writel(0x44444004, MVEBU_MPP_BASE + 0x08);
40 writel(0x14444444, MVEBU_MPP_BASE + 0x0c);
41 writel(0x00000001, MVEBU_MPP_BASE + 0x10);
42
43 /*
44 * MVEBU_GPIO0_BASE is the User LED
45 * MVEBU_GPIO1_BASE is the Reset Button (currently not used)
46 */
47
48 /* Set GPP Out value */
49 writel(DB_DX_AC3_GPP_OUT_VAL_LOW, MVEBU_GPIO0_BASE + 0x00);
50 /* writel(DB_DX_AC3_GPP_OUT_VAL_MID, MVEBU_GPIO1_BASE + 0x00); */
51
52 /* Set GPP Polarity */
53 writel(DB_DX_AC3_GPP_POL_LOW, MVEBU_GPIO0_BASE + 0x0c);
54 /* writel(DB_DX_AC3_GPP_POL_MID, MVEBU_GPIO1_BASE + 0x0c); */
55
56 /* Set GPP Out Enable */
57 writel(DB_DX_AC3_GPP_OUT_ENA_LOW, MVEBU_GPIO0_BASE + 0x04);
58 /* writel(DB_DX_AC3_GPP_OUT_ENA_MID, MVEBU_GPIO1_BASE + 0x04); */
59
60 return 0;
61}
62
63int board_init(void)
64{
65 /* address of boot parameters */
66 gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
67
68 return 0;
69}
70
71int checkboard(void)
72{
73 puts("Board: " CONFIG_SYS_BOARD "\n");
74
75 return 0;
76}