nmhw: cleanup/align with nrsw code

This commit is contained in:
Rene Straub 2019-09-25 11:10:25 +02:00
parent afbe8bf08d
commit aea345876d
6 changed files with 8 additions and 18 deletions

View File

@ -45,14 +45,11 @@ static const struct ns16550_platdata am33xx_serial[] = {
{ .base = CONFIG_SYS_NS16550_COM2, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, { .base = CONFIG_SYS_NS16550_COM2, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
# ifdef CONFIG_SYS_NS16550_COM3 # ifdef CONFIG_SYS_NS16550_COM3
{ .base = CONFIG_SYS_NS16550_COM3, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, { .base = CONFIG_SYS_NS16550_COM3, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
# if 0 /* TODO: @@@rs */
{ .base = CONFIG_SYS_NS16550_COM4, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, { .base = CONFIG_SYS_NS16550_COM4, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
{ .base = CONFIG_SYS_NS16550_COM5, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, { .base = CONFIG_SYS_NS16550_COM5, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
{ .base = CONFIG_SYS_NS16550_COM6, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, { .base = CONFIG_SYS_NS16550_COM6, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
# endif # endif
# endif # endif
# endif
}; };
U_BOOT_DEVICES(am33xx_uarts) = { U_BOOT_DEVICES(am33xx_uarts) = {
@ -61,13 +58,11 @@ U_BOOT_DEVICES(am33xx_uarts) = {
{ "ns16550_serial", &am33xx_serial[1] }, { "ns16550_serial", &am33xx_serial[1] },
# ifdef CONFIG_SYS_NS16550_COM3 # ifdef CONFIG_SYS_NS16550_COM3
{ "ns16550_serial", &am33xx_serial[2] }, { "ns16550_serial", &am33xx_serial[2] },
# if 0 /* TODO: @@@rs */
{ "ns16550_serial", &am33xx_serial[3] }, { "ns16550_serial", &am33xx_serial[3] },
{ "ns16550_serial", &am33xx_serial[4] }, { "ns16550_serial", &am33xx_serial[4] },
{ "ns16550_serial", &am33xx_serial[5] }, { "ns16550_serial", &am33xx_serial[5] },
# endif # endif
# endif # endif
# endif
}; };
#ifdef CONFIG_DM_GPIO #ifdef CONFIG_DM_GPIO

View File

@ -170,7 +170,7 @@ void enable_basic_clocks(void)
&cmper->usb0clkctrl, &cmper->usb0clkctrl,
&cmper->emiffwclkctrl, &cmper->emiffwclkctrl,
&cmper->emifclkctrl, &cmper->emifclkctrl,
&cmper->i2c2clkctrl, /* TODO: Check whether required now that I2C1 is used */ &cmper->i2c2clkctrl,
&cmper->spi1clkctrl, &cmper->spi1clkctrl,
0 0
}; };

View File

@ -1,6 +1,7 @@
#include <common.h> #include <common.h>
#include <fs.h> #include <fs.h>
#define BLOCK_DEVICE "mmc"
#define OVERLAY_PART "1:3" #define OVERLAY_PART "1:3"
int read_file(const char* filename, char *buf, int size) int read_file(const char* filename, char *buf, int size)
@ -9,14 +10,12 @@ int read_file(const char* filename, char *buf, int size)
loff_t len; loff_t len;
int ret; int ret;
/* If consoldev is set take this as productive conosle instead of default console */ if (fs_set_blk_dev(BLOCK_DEVICE, OVERLAY_PART, FS_TYPE_EXT) != 0) {
if (fs_set_blk_dev("mmc", OVERLAY_PART, FS_TYPE_EXT) != 0) {
puts("Error, can not set blk device\n"); puts("Error, can not set blk device\n");
return -1; return -1;
} }
/* Read at most file size bytes */
/* File does not exist, do not print an error message */
if (fs_size(filename, &filesize)) { if (fs_size(filename, &filesize)) {
return -1; return -1;
} }
@ -24,13 +23,12 @@ int read_file(const char* filename, char *buf, int size)
if (filesize < size) if (filesize < size)
size = filesize; size = filesize;
/* If consoldev is set take this as productive conosle instead of default console */ /* For very unclear reasons the block device needs to be set again after the call to fs_size() */
if (fs_set_blk_dev("mmc", OVERLAY_PART, FS_TYPE_EXT) != 0) { if (fs_set_blk_dev(BLOCK_DEVICE, OVERLAY_PART, FS_TYPE_EXT) != 0) {
puts("Error, can not set blk device\n"); puts("Error, can not set blk device\n");
return -1; return -1;
} }
if ((ret = fs_read(filename, (ulong)buf, 0, size, &len))) { if ((ret = fs_read(filename, (ulong)buf, 0, size, &len))) {
printf("Can't read file %s (size %d, len %lld, ret %d)\n", filename, size, len, ret); printf("Can't read file %s (size %d, len %lld, ret %d)\n", filename, size, len, ret);
return -1; return -1;

View File

@ -243,7 +243,6 @@ int genphy_update_link(struct phy_device *phydev)
if ((phydev->autoneg == AUTONEG_ENABLE) && if ((phydev->autoneg == AUTONEG_ENABLE) &&
!(mii_reg & BMSR_ANEGCOMPLETE)) { !(mii_reg & BMSR_ANEGCOMPLETE)) {
const int timeout = PHY_ANEG_TIMEOUT;
int i = 0; int i = 0;
printf("%s Waiting for PHY auto negotiation to complete", printf("%s Waiting for PHY auto negotiation to complete",
@ -252,7 +251,7 @@ int genphy_update_link(struct phy_device *phydev)
/* /*
* Timeout reached ? * Timeout reached ?
*/ */
if (i > timeout) { if (i > PHY_ANEG_TIMEOUT) {
printf(" TIMEOUT !\n"); printf(" TIMEOUT !\n");
phydev->link = 0; phydev->link = 0;
return -ETIMEDOUT; return -ETIMEDOUT;

View File

@ -307,8 +307,6 @@ int fs_read(const char *filename, ulong addr, loff_t offset, loff_t len,
unmap_sysmem(buf); unmap_sysmem(buf);
/* If we requested a specific number of bytes, check we got it */ /* If we requested a specific number of bytes, check we got it */
if (ret == 0 && len && *actread != len)
printf("** %s shorter than offset + len **\n", filename);
fs_close(); fs_close();
return ret; return ret;