Merge branch '2022-06-16-assorted-bugfixes'

- A wide array of regression fixes and minor updates
This commit is contained in:
Tom Rini
2022-06-17 09:13:50 -04:00
17 changed files with 67 additions and 26 deletions

2
.gitignore vendored
View File

@@ -10,6 +10,7 @@
*.asn1.[ch]
*.bin
*.cfgout
*.cover
*.dtb
*.dtbo
*.dtb.S
@@ -22,6 +23,7 @@
*.lex.c
*.lst
*.mod.c
*.mbx
*.o
*.o.*
*.order

View File

@@ -39,8 +39,28 @@ DECLARE_GLOBAL_DATA_PTR;
* off: FFF
*/
u64 get_tcr(int el, u64 *pips, u64 *pva_bits)
static int get_effective_el(void)
{
int el = current_el();
if (el == 2) {
u64 hcr_el2;
/*
* If we are using the EL2&0 translation regime, the TCR_EL2
* looks like the EL1 version, even though we are in EL2.
*/
__asm__ ("mrs %0, HCR_EL2\n" : "=r" (hcr_el2));
if (hcr_el2 & BIT(HCR_EL2_E2H_BIT))
return 1;
}
return el;
}
u64 get_tcr(u64 *pips, u64 *pva_bits)
{
int el = get_effective_el();
u64 max_addr = 0;
u64 ips, va_bits;
u64 tcr;
@@ -115,7 +135,7 @@ static u64 *find_pte(u64 addr, int level)
debug("addr=%llx level=%d\n", addr, level);
get_tcr(0, NULL, &va_bits);
get_tcr(NULL, &va_bits);
if (va_bits < 39)
start_level = 1;
@@ -343,7 +363,7 @@ __weak u64 get_page_table_size(void)
u64 va_bits;
int start_level = 0;
get_tcr(0, NULL, &va_bits);
get_tcr(NULL, &va_bits);
if (va_bits < 39)
start_level = 1;
@@ -415,7 +435,7 @@ __weak void mmu_setup(void)
setup_all_pgtables();
el = current_el();
set_ttbr_tcr_mair(el, gd->arch.tlb_addr, get_tcr(el, NULL, NULL),
set_ttbr_tcr_mair(el, gd->arch.tlb_addr, get_tcr(NULL, NULL),
MEMORY_ATTRIBUTES);
/* enable the mmu */

View File

@@ -454,7 +454,7 @@ static inline void early_mmu_setup(void)
/* point TTBR to the new table */
set_ttbr_tcr_mair(el, gd->arch.tlb_addr,
get_tcr(el, NULL, NULL) &
get_tcr(NULL, NULL) &
~(TCR_ORGN_MASK | TCR_IRGN_MASK),
MEMORY_ATTRIBUTES);
@@ -609,7 +609,7 @@ static inline void final_mmu_setup(void)
invalidate_icache_all();
/* point TTBR to the new table */
set_ttbr_tcr_mair(el, gd->arch.tlb_addr, get_tcr(el, NULL, NULL),
set_ttbr_tcr_mair(el, gd->arch.tlb_addr, get_tcr(NULL, NULL),
MEMORY_ATTRIBUTES);
set_sctlr(get_sctlr() | CR_M);

View File

@@ -125,7 +125,7 @@ pie_fixup_done:
msr cptr_el3, xzr /* Enable FP/SIMD */
b 0f
2: mrs x1, hcr_el2
tbnz x1, #34, 1f /* HCR_EL2.E2H */
tbnz x1, #HCR_EL2_E2H_BIT, 1f /* HCR_EL2.E2H */
orr x1, x1, #HCR_EL2_AMO_EL2 /* Route SErrors to EL2 */
msr hcr_el2, x1
set_vbar vbar_el2, x0

View File

@@ -10,3 +10,18 @@
sd-uhs-sdr104;
sd-uhs-ddr50;
};
&uart1 {
/delete-property/ assigned-clocks;
/delete-property/ assigned-clock-parents;
};
&uart2 {
/delete-property/ assigned-clocks;
/delete-property/ assigned-clock-parents;
};
&uart3 {
/delete-property/ assigned-clocks;
/delete-property/ assigned-clock-parents;
};

View File

@@ -103,6 +103,8 @@
#define TCR_EL2_RSVD (1U << 31 | 1 << 23)
#define TCR_EL3_RSVD (1U << 31 | 1 << 23)
#define HCR_EL2_E2H_BIT 34
#ifndef __ASSEMBLY__
static inline void set_ttbr_tcr_mair(int el, u64 table, u64 tcr, u64 attr)
{
@@ -134,7 +136,7 @@ struct mm_region {
extern struct mm_region *mem_map;
void setup_pgtables(void);
u64 get_tcr(int el, u64 *pips, u64 *pva_bits);
u64 get_tcr(u64 *pips, u64 *pva_bits);
#endif
#endif /* _ASM_ARMV8_MMU_H_ */

View File

@@ -47,6 +47,9 @@ static void ctrl_mmr_unlock(void)
mmr_unlock(CTRL_MMR0_BASE, 3);
mmr_unlock(CTRL_MMR0_BASE, 5);
mmr_unlock(CTRL_MMR0_BASE, 6);
/* Unlock all MCU_PADCFG_MMR1 module registers */
mmr_unlock(MCU_PADCFG_MMR1_BASE, 1);
}
/*

View File

@@ -1,5 +1,5 @@
BOARDS from CS Systemes d'Information
M: Christophe Leroy <christophe.leroy@c-s.fr>
BOARDS from CS GROUP France
M: Christophe Leroy <christophe.leroy@csgroup.eu>
S: Maintained
F: board/cssi/
F: include/configs/MCR3000.h

View File

@@ -902,7 +902,7 @@ int board_late_init(void)
#endif
/* CPSW plat */
#if !CONFIG_IS_ENABLED(OF_CONTROL)
#if CONFIG_IS_ENABLED(NET) && !CONFIG_IS_ENABLED(OF_CONTROL)
struct cpsw_slave_data slave_data[] = {
{
.slave_reg_ofs = CPSW_SLAVE0_OFFSET,

View File

@@ -95,7 +95,7 @@ alias nios2 nios
alias powerpc uboot, afleming, stroese, wd, priyankajain, mariosix
alias ppc powerpc
alias mpc8xx uboot, wd, Christophe Leroy <christophe.leroy@c-s.fr>
alias mpc8xx uboot, wd, Christophe Leroy <christophe.leroy@csgroup.eu>
alias mpc83xx uboot, mariosix
alias mpc85xx uboot, afleming, priyankajain

View File

@@ -176,12 +176,6 @@ int caam_hash(const unsigned char *pbuf, unsigned int buf_len,
uint32_t *desc;
unsigned int size;
if (!IS_ALIGNED((uintptr_t)pbuf, ARCH_DMA_MINALIGN) ||
!IS_ALIGNED((uintptr_t)pout, ARCH_DMA_MINALIGN)) {
puts("Error: Address arguments are not aligned\n");
return -EINVAL;
}
desc = malloc_cache_aligned(sizeof(int) * MAX_CAAM_DESCSIZE);
if (!desc) {
debug("Not enough memory for descriptor allocation\n");

View File

@@ -69,7 +69,7 @@ static int ehci_usb_probe(struct udevice *dev)
err = 0;
ret = clk_get_bulk(dev, &priv->clocks);
if (ret) {
if (ret && ret != -ENOENT) {
dev_err(dev, "Failed to get clocks (ret=%d)\n", ret);
return ret;
}
@@ -81,7 +81,7 @@ static int ehci_usb_probe(struct udevice *dev)
}
err = reset_get_bulk(dev, &priv->resets);
if (err) {
if (ret && ret != -ENOENT) {
dev_err(dev, "Failed to get resets (err=%d)\n", err);
goto clk_err;
}

View File

@@ -975,6 +975,7 @@ int sqfs_readdir(struct fs_dir_stream *fs_dirs, struct fs_dirent **dentp)
int i_number, offset = 0, ret;
struct fs_dirent *dent;
unsigned char *ipos;
u16 name_size;
dirs = (struct squashfs_dir_stream *)fs_dirs;
if (!dirs->size) {
@@ -1057,9 +1058,10 @@ int sqfs_readdir(struct fs_dir_stream *fs_dirs, struct fs_dirent **dentp)
return -SQFS_STOP_READDIR;
}
/* Set entry name */
strncpy(dent->name, dirs->entry->name, dirs->entry->name_size + 1);
dent->name[dirs->entry->name_size + 1] = '\0';
/* Set entry name (capped at FS_DIRENT_NAME_LEN which is a U-Boot limitation) */
name_size = min_t(u16, dirs->entry->name_size + 1, FS_DIRENT_NAME_LEN - 1);
strncpy(dent->name, dirs->entry->name, name_size);
dent->name[name_size] = '\0';
offset = dirs->entry->name_size + 1 + SQFS_ENTRY_BASE_LENGTH;
dirs->entry_count--;

View File

@@ -86,6 +86,7 @@
"rootfstype=ext4\0" \
"console=console=ttySAC2,115200n8\0" \
"fdtfile=exynos5422-odroidxu3.dtb\0" \
"board=odroid\0" \
"board_name=odroidxu3\0" \
"mmcbootdev=0\0" \
"mmcrootdev=0\0" \

View File

@@ -174,6 +174,8 @@ int fs_write(const char *filename, ulong addr, loff_t offset, loff_t len,
#define FS_DT_REG 8 /* regular file */
#define FS_DT_LNK 10 /* symbolic link */
#define FS_DIRENT_NAME_LEN 256
/**
* struct fs_dirent - directory entry
*
@@ -194,7 +196,7 @@ struct fs_dirent {
/** change_time: time of last modification */
struct rtc_time change_time;
/** name: file name */
char name[256];
char name[FS_DIRENT_NAME_LEN];
};
/* Note: fs_dir_stream should be treated as opaque to the user of fs layer */

View File

@@ -158,7 +158,7 @@ config UDP_CHECKSUM
default y if SANDBOX
help
Enable this to verify the checksum on UDP packets. If the checksum
is wrong then the packet is discussed and an error is shown, like
is wrong then the packet is discarded and an error is shown, like
"UDP wrong checksum 29374a23 30ff3826"
config BOOTP_SERVERIP

View File

@@ -5,7 +5,7 @@ setup(name='binman',
version='1.0',
license='GPL-2.0+',
scripts=['binman'],
packages=['binman', 'binman.etype'],
packages=['binman', 'binman.etype', 'binman.btool'],
package_dir={'binman': ''},
package_data={'binman': ['README.rst', 'entries.rst']},
classifiers=['Environment :: Console',