Skip to content

Commit e71dc5b

Browse files
committed
Merge tag 'mips-fixes_6.4_1' into mips-next
- fixes to get alchemy platform back in shape - fix for initrd detection
2 parents 12324a8 + 4897a89 commit e71dc5b

File tree

4 files changed

+26
-16
lines changed

4 files changed

+26
-16
lines changed

arch/mips/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ config MIPS
7979
select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
8080
select HAVE_MOD_ARCH_SPECIFIC
8181
select HAVE_NMI
82+
select HAVE_PATA_PLATFORM
8283
select HAVE_PERF_EVENTS
8384
select HAVE_PERF_REGS
8485
select HAVE_PERF_USER_STACK_DUMP

arch/mips/alchemy/common/dbdma.c

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
*
3131
*/
3232

33+
#include <linux/dma-map-ops.h> /* for dma_default_coherent */
3334
#include <linux/init.h>
3435
#include <linux/kernel.h>
3536
#include <linux/slab.h>
@@ -623,17 +624,18 @@ u32 au1xxx_dbdma_put_source(u32 chanid, dma_addr_t buf, int nbytes, u32 flags)
623624
dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
624625

625626
/*
626-
* There is an errata on the Au1200/Au1550 parts that could result
627-
* in "stale" data being DMA'ed. It has to do with the snoop logic on
628-
* the cache eviction buffer. DMA_NONCOHERENT is on by default for
629-
* these parts. If it is fixed in the future, these dma_cache_inv will
630-
* just be nothing more than empty macros. See io.h.
627+
* There is an erratum on certain Au1200/Au1550 revisions that could
628+
* result in "stale" data being DMA'ed. It has to do with the snoop
629+
* logic on the cache eviction buffer. dma_default_coherent is set
630+
* to false on these parts.
631631
*/
632-
dma_cache_wback_inv((unsigned long)buf, nbytes);
632+
if (!dma_default_coherent)
633+
dma_cache_wback_inv(KSEG0ADDR(buf), nbytes);
633634
dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
634635
wmb(); /* drain writebuffer */
635636
dma_cache_wback_inv((unsigned long)dp, sizeof(*dp));
636637
ctp->chan_ptr->ddma_dbell = 0;
638+
wmb(); /* force doorbell write out to dma engine */
637639

638640
/* Get next descriptor pointer. */
639641
ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
@@ -685,17 +687,18 @@ u32 au1xxx_dbdma_put_dest(u32 chanid, dma_addr_t buf, int nbytes, u32 flags)
685687
dp->dscr_source1, dp->dscr_dest0, dp->dscr_dest1);
686688
#endif
687689
/*
688-
* There is an errata on the Au1200/Au1550 parts that could result in
689-
* "stale" data being DMA'ed. It has to do with the snoop logic on the
690-
* cache eviction buffer. DMA_NONCOHERENT is on by default for these
691-
* parts. If it is fixed in the future, these dma_cache_inv will just
692-
* be nothing more than empty macros. See io.h.
690+
* There is an erratum on certain Au1200/Au1550 revisions that could
691+
* result in "stale" data being DMA'ed. It has to do with the snoop
692+
* logic on the cache eviction buffer. dma_default_coherent is set
693+
* to false on these parts.
693694
*/
694-
dma_cache_inv((unsigned long)buf, nbytes);
695+
if (!dma_default_coherent)
696+
dma_cache_inv(KSEG0ADDR(buf), nbytes);
695697
dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
696698
wmb(); /* drain writebuffer */
697699
dma_cache_wback_inv((unsigned long)dp, sizeof(*dp));
698700
ctp->chan_ptr->ddma_dbell = 0;
701+
wmb(); /* force doorbell write out to dma engine */
699702

700703
/* Get next descriptor pointer. */
701704
ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));

arch/mips/kernel/cpu-probe.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,6 +1502,10 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu)
15021502
break;
15031503
}
15041504
break;
1505+
case PRID_IMP_NETLOGIC_AU13XX:
1506+
c->cputype = CPU_ALCHEMY;
1507+
__cpu_name[cpu] = "Au1300";
1508+
break;
15051509
}
15061510
}
15071511

@@ -1863,6 +1867,7 @@ void cpu_probe(void)
18631867
cpu_probe_mips(c, cpu);
18641868
break;
18651869
case PRID_COMP_ALCHEMY:
1870+
case PRID_COMP_NETLOGIC:
18661871
cpu_probe_alchemy(c, cpu);
18671872
break;
18681873
case PRID_COMP_SIBYTE:

arch/mips/kernel/setup.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,6 @@ static unsigned long __init init_initrd(void)
158158
pr_err("initrd start must be page aligned\n");
159159
goto disable;
160160
}
161-
if (initrd_start < PAGE_OFFSET) {
162-
pr_err("initrd start < PAGE_OFFSET\n");
163-
goto disable;
164-
}
165161

166162
/*
167163
* Sanitize initrd addresses. For example firmware
@@ -174,6 +170,11 @@ static unsigned long __init init_initrd(void)
174170
initrd_end = (unsigned long)__va(end);
175171
initrd_start = (unsigned long)__va(__pa(initrd_start));
176172

173+
if (initrd_start < PAGE_OFFSET) {
174+
pr_err("initrd start < PAGE_OFFSET\n");
175+
goto disable;
176+
}
177+
177178
ROOT_DEV = Root_RAM0;
178179
return PFN_UP(end);
179180
disable:

0 commit comments

Comments
 (0)