Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
f31f5367
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f31f5367
编写于
7月 21, 2021
作者:
T
Tom Rini
浏览文件
操作
浏览文件
下载
差异文件
Merge
https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
上级
c9204859
219cb173
变更
8
展开全部
显示空白变更内容
内联
并排
Showing
8 changed file
with
81 addition
and
1569 deletion
+81
-1569
arch/riscv/dts/Makefile
arch/riscv/dts/Makefile
+1
-1
arch/riscv/dts/fu740-hifive-unmatched-a00-ddr-rev1.dtsi
arch/riscv/dts/fu740-hifive-unmatched-a00-ddr-rev1.dtsi
+0
-1489
arch/riscv/dts/hifive-unmatched-a00-rev1-u-boot.dtsi
arch/riscv/dts/hifive-unmatched-a00-rev1-u-boot.dtsi
+0
-7
arch/riscv/dts/hifive-unmatched-a00-rev1.dts
arch/riscv/dts/hifive-unmatched-a00-rev1.dts
+0
-4
arch/riscv/lib/image.c
arch/riscv/lib/image.c
+6
-1
board/sifive/unmatched/hifive-platform-i2c-eeprom.c
board/sifive/unmatched/hifive-platform-i2c-eeprom.c
+1
-22
board/sifive/unmatched/spl.c
board/sifive/unmatched/spl.c
+73
-41
configs/sifive_unmatched_defconfig
configs/sifive_unmatched_defconfig
+0
-4
未找到文件。
arch/riscv/dts/Makefile
浏览文件 @
f31f5367
...
...
@@ -5,7 +5,7 @@ dtb-$(CONFIG_TARGET_MICROCHIP_ICICLE) += microchip-mpfs-icicle-kit.dtb
dtb-$(CONFIG_TARGET_QEMU_VIRT)
+=
qemu-virt.dtb
dtb-$(CONFIG_TARGET_OPENPITON_RISCV64)
+=
openpiton-riscv64.dtb
dtb-$(CONFIG_TARGET_SIFIVE_UNLEASHED)
+=
hifive-unleashed-a00.dtb
dtb-$(CONFIG_TARGET_SIFIVE_UNMATCHED)
+=
hifive-unmatched-a00.dtb
hifive-unmatched-a00-rev1.dtb
dtb-$(CONFIG_TARGET_SIFIVE_UNMATCHED)
+=
hifive-unmatched-a00.dtb
dtb-$(CONFIG_TARGET_SIPEED_MAIX)
+=
k210-maix-bit.dtb
targets
+=
$
(
dtb-y
)
...
...
arch/riscv/dts/fu740-hifive-unmatched-a00-ddr-rev1.dtsi
已删除
100644 → 0
浏览文件 @
c9204859
此差异已折叠。
点击以展开。
arch/riscv/dts/hifive-unmatched-a00-rev1-u-boot.dtsi
已删除
100644 → 0
浏览文件 @
c9204859
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
* Copyright (C) 2021 SiFive, Inc
*/
#include "hifive-unmatched-a00-u-boot.dtsi"
#include "fu740-hifive-unmatched-a00-ddr-rev1.dtsi"
arch/riscv/dts/hifive-unmatched-a00-rev1.dts
已删除
100644 → 0
浏览文件 @
c9204859
// SPDX-License-Identifier: GPL-2.0+
/* Copyright (c) 2021 SiFive, Inc */
#include "hifive-unmatched-a00.dts"
arch/riscv/lib/image.c
浏览文件 @
f31f5367
...
...
@@ -50,7 +50,12 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size,
return
-
EINVAL
;
}
*
size
=
lhdr
->
image_size
;
if
(
force_reloc
||
(
gd
->
ram_base
<=
image
&&
image
<
gd
->
ram_base
+
gd
->
ram_size
))
{
*
relocated_addr
=
gd
->
ram_base
+
lhdr
->
text_offset
;
}
else
{
*
relocated_addr
=
image
;
}
unmap_sysmem
(
lhdr
);
...
...
board/sifive/unmatched/hifive-platform-i2c-eeprom.c
浏览文件 @
f31f5367
...
...
@@ -401,24 +401,6 @@ static void set_product_id(char *string)
update_crc
();
}
/**
* set_serial_number() - set the PCB serial number in the in-memory copy
*
* Set the board serial number in the in-memory EEPROM copy from the supplied
* string argument, and update the CRC.
*/
static
void
set_serial_number
(
char
*
string
)
{
if
(
strlen
(
string
)
>
SERIAL_NUMBER_BYTES
)
{
printf
(
"Serial number must not be greater than 16 bytes
\n
"
);
return
;
}
memset
(
e
.
serial
,
0
,
sizeof
(
e
.
serial
));
strncpy
((
char
*
)
e
.
serial
,
string
,
sizeof
(
e
.
serial
));
update_crc
();
}
/**
* init_local_copy() - initialize the in-memory EEPROM copy
*
...
...
@@ -468,10 +450,7 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
return
0
;
}
if
(
!
strcmp
(
cmd
,
"serial_number"
))
{
set_serial_number
(
argv
[
2
]);
return
0
;
}
else
if
(
!
strcmp
(
cmd
,
"manuf_test_status"
))
{
if
(
!
strcmp
(
cmd
,
"manuf_test_status"
))
{
set_manuf_test_status
(
argv
[
2
]);
return
0
;
}
else
if
(
!
strcmp
(
cmd
,
"mac_address"
))
{
...
...
board/sifive/unmatched/spl.c
浏览文件 @
f31f5367
...
...
@@ -10,68 +10,111 @@
#include <spl.h>
#include <misc.h>
#include <log.h>
#include <fdtdec.h>
#include <dm/root.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <asm/gpio.h>
#include <asm/arch/gpio.h>
#include <asm/arch/spl.h>
#include <asm/arch/eeprom.h>
#define UBRDG_RESET SIFIVE_GENERIC_GPIO_NR(0, 7)
#define ULPI_RESET SIFIVE_GENERIC_GPIO_NR(0, 9)
#define UHUB_RESET SIFIVE_GENERIC_GPIO_NR(0, 11)
#define GEM_PHY_RESET SIFIVE_GENERIC_GPIO_NR(0, 12)
#define MODE_SELECT_REG 0x1000
#define MODE_SELECT_SD 0xb
#define MODE_SELECT_MASK GENMASK(3, 0)
int
spl_board_init_f
(
void
)
static
inline
int
spl_reset_device_by_gpio
(
const
char
*
label
,
int
pin
,
int
low_width
)
{
int
ret
;
#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_MULTI_DTB_FIT)
int
rescan
;
ret
=
fdtdec_resetup
(
&
rescan
);
if
(
!
ret
&&
rescan
)
{
dm_uninit
();
dm_init_and_scan
(
true
);
ret
=
gpio_request
(
pin
,
label
);
if
(
ret
)
{
debug
(
"%s gpio request failed: %d
\n
"
,
label
,
ret
);
return
ret
;
}
#endif
ret
=
spl_soc_init
(
);
ret
=
gpio_direction_output
(
pin
,
1
);
if
(
ret
)
{
debug
(
"
HiFive Unmatched FU740 SPL init failed: %d
\n
"
,
ret
);
debug
(
"
%s gpio direction set failed: %d
\n
"
,
label
,
ret
);
return
ret
;
}
udelay
(
1
);
gpio_set_value
(
pin
,
0
);
udelay
(
low_width
);
gpio_set_value
(
pin
,
1
);
return
ret
;
}
static
inline
int
spl_gemgxl_init
(
void
)
{
int
ret
;
/*
* GEMGXL init VSC8541 PHY reset sequence;
* leave pull-down active for 2ms
*/
udelay
(
2000
);
ret
=
gpio_request
(
GEM_PHY_RESET
,
"gem_phy_reset"
);
if
(
ret
)
{
debug
(
"gem_phy_reset gpio request failed: %d
\n
"
,
ret
);
ret
=
spl_reset_device_by_gpio
(
"gem_phy_reset"
,
GEM_PHY_RESET
,
1
);
mdelay
(
15
);
return
ret
;
}
static
inline
int
spl_usb_pcie_bridge_init
(
void
)
{
return
spl_reset_device_by_gpio
(
"usb_pcie_bridge_reset"
,
UBRDG_RESET
,
3000
);
}
static
inline
int
spl_usb_hub_init
(
void
)
{
return
spl_reset_device_by_gpio
(
"usb_hub_reset"
,
UHUB_RESET
,
100
);
}
static
inline
int
spl_ulpi_init
(
void
)
{
return
spl_reset_device_by_gpio
(
"ulpi_reset"
,
ULPI_RESET
,
1
);
}
int
spl_board_init_f
(
void
)
{
int
ret
;
ret
=
spl_soc_init
();
if
(
ret
)
{
debug
(
"HiFive Unmatched FU740 SPL init failed: %d
\n
"
,
ret
);
goto
end
;
}
/* Set GPIO 12 (PHY NRESET) */
ret
=
gpio_direction_output
(
GEM_PHY_RESET
,
1
);
ret
=
spl_gemgxl_init
();
if
(
ret
)
{
debug
(
"
gem_phy_reset gpio direction se
t failed: %d
\n
"
,
ret
);
return
ret
;
debug
(
"
Gigabit ethernet PHY (VSC8541) ini
t failed: %d
\n
"
,
ret
);
goto
end
;
}
udelay
(
1
);
ret
=
spl_usb_pcie_bridge_init
();
if
(
ret
)
{
debug
(
"USB Bridge (ASM1042A) init failed: %d
\n
"
,
ret
);
goto
end
;
}
/* Reset PHY again to enter unmanaged mode */
gpio_set_value
(
GEM_PHY_RESET
,
0
);
udelay
(
1
);
gpio_set_value
(
GEM_PHY_RESET
,
1
)
;
mdelay
(
15
);
ret
=
spl_usb_hub_init
();
if
(
ret
)
{
debug
(
"USB Hub (ASM1074) init failed: %d
\n
"
,
ret
);
goto
end
;
}
return
0
;
ret
=
spl_ulpi_init
();
if
(
ret
)
{
debug
(
"USB 2.0 PHY (USB3320C) init failed: %d
\n
"
,
ret
);
goto
end
;
}
end:
return
ret
;
}
u32
spl_boot_device
(
void
)
...
...
@@ -92,18 +135,7 @@ u32 spl_boot_device(void)
#ifdef CONFIG_SPL_LOAD_FIT
int
board_fit_config_name_match
(
const
char
*
name
)
{
/*
* Apply different DDR params on different board revision.
* Use PCB revision which is byte 0x7 in I2C platform EEPROM
* to distinguish that.
*/
if
(
get_pcb_revision_from_eeprom
()
==
PCB_REVISION_REV3
&&
!
strcmp
(
name
,
"hifive-unmatched-a00"
))
return
0
;
else
if
(
get_pcb_revision_from_eeprom
()
!=
PCB_REVISION_REV3
&&
!
strcmp
(
name
,
"hifive-unmatched-a00-rev1"
))
/* boot using first FIT config */
return
0
;
return
-
1
;
}
#endif
configs/sifive_unmatched_defconfig
浏览文件 @
f31f5367
...
...
@@ -5,7 +5,6 @@ CONFIG_NR_DRAM_BANKS=1
CONFIG_SPL_DM_SPI=y
CONFIG_DEFAULT_DEVICE_TREE="hifive-unmatched-a00"
CONFIG_SPL_MMC_SUPPORT=y
CONFIG_SPL_SYS_MALLOC_F_LEN=0x100000
CONFIG_SPL=y
CONFIG_SPL_SPI_SUPPORT=y
CONFIG_TARGET_SIFIVE_UNMATCHED=y
...
...
@@ -28,9 +27,6 @@ CONFIG_CMD_PWM=y
CONFIG_CMD_GPT_RENAME=y
CONFIG_CMD_PCI=y
CONFIG_CMD_USB=y
CONFIG_SPL_MULTI_DTB_FIT=y
CONFIG_SPL_OF_LIST="hifive-unmatched-a00 hifive-unmatched-a00-rev1"
CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_SPL_CLK=y
CONFIG_E1000=y
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录