Skip to content

Commit 455ffa6

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2 parents 3ab0b24 + 115e8e7 commit 455ffa6

36 files changed

Lines changed: 189 additions & 176 deletions

File tree

‎arch/arm/Kconfig‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ config PL310_ERRATA_588369
12461246

12471247
config ARM_ERRATA_720789
12481248
bool "ARM errata: TLBIASIDIS and TLBIMVAIS operations can broadcast a faulty ASID"
1249-
depends on CPU_V7 && SMP
1249+
depends on CPU_V7
12501250
help
12511251
This option enables the workaround for the 720789 Cortex-A9 (prior to
12521252
r2p0) erratum. A faulty ASID can be sent to the other CPUs for the
@@ -1282,7 +1282,7 @@ config ARM_ERRATA_743622
12821282

12831283
config ARM_ERRATA_751472
12841284
bool "ARM errata: Interrupted ICIALLUIS may prevent completion of broadcasted operation"
1285-
depends on CPU_V7 && SMP
1285+
depends on CPU_V7
12861286
help
12871287
This option enables the workaround for the 751472 Cortex-A9 (prior
12881288
to r3p0) erratum. An interrupted ICIALLUIS operation may prevent the

‎arch/arm/common/pl330.c‎

Lines changed: 49 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -221,17 +221,6 @@
221221
*/
222222
#define MCODE_BUFF_PER_REQ 256
223223

224-
/*
225-
* Mark a _pl330_req as free.
226-
* We do it by writing DMAEND as the first instruction
227-
* because no valid request is going to have DMAEND as
228-
* its first instruction to execute.
229-
*/
230-
#define MARK_FREE(req) do { \
231-
_emit_END(0, (req)->mc_cpu); \
232-
(req)->mc_len = 0; \
233-
} while (0)
234-
235224
/* If the _pl330_req is available to the client */
236225
#define IS_FREE(req) (*((u8 *)((req)->mc_cpu)) == CMD_DMAEND)
237226

@@ -301,8 +290,10 @@ struct pl330_thread {
301290
struct pl330_dmac *dmac;
302291
/* Only two at a time */
303292
struct _pl330_req req[2];
304-
/* Index of the last submitted request */
293+
/* Index of the last enqueued request */
305294
unsigned lstenq;
295+
/* Index of the last submitted request or -1 if the DMA is stopped */
296+
int req_running;
306297
};
307298

308299
enum pl330_dmac_state {
@@ -778,6 +769,22 @@ static inline void _execute_DBGINSN(struct pl330_thread *thrd,
778769
writel(0, regs + DBGCMD);
779770
}
780771

772+
/*
773+
* Mark a _pl330_req as free.
774+
* We do it by writing DMAEND as the first instruction
775+
* because no valid request is going to have DMAEND as
776+
* its first instruction to execute.
777+
*/
778+
static void mark_free(struct pl330_thread *thrd, int idx)
779+
{
780+
struct _pl330_req *req = &thrd->req[idx];
781+
782+
_emit_END(0, req->mc_cpu);
783+
req->mc_len = 0;
784+
785+
thrd->req_running = -1;
786+
}
787+
781788
static inline u32 _state(struct pl330_thread *thrd)
782789
{
783790
void __iomem *regs = thrd->dmac->pinfo->base;
@@ -836,31 +843,6 @@ static inline u32 _state(struct pl330_thread *thrd)
836843
}
837844
}
838845

839-
/* If the request 'req' of thread 'thrd' is currently active */
840-
static inline bool _req_active(struct pl330_thread *thrd,
841-
struct _pl330_req *req)
842-
{
843-
void __iomem *regs = thrd->dmac->pinfo->base;
844-
u32 buf = req->mc_bus, pc = readl(regs + CPC(thrd->id));
845-
846-
if (IS_FREE(req))
847-
return false;
848-
849-
return (pc >= buf && pc <= buf + req->mc_len) ? true : false;
850-
}
851-
852-
/* Returns 0 if the thread is inactive, ID of active req + 1 otherwise */
853-
static inline unsigned _thrd_active(struct pl330_thread *thrd)
854-
{
855-
if (_req_active(thrd, &thrd->req[0]))
856-
return 1; /* First req active */
857-
858-
if (_req_active(thrd, &thrd->req[1]))
859-
return 2; /* Second req active */
860-
861-
return 0;
862-
}
863-
864846
static void _stop(struct pl330_thread *thrd)
865847
{
866848
void __iomem *regs = thrd->dmac->pinfo->base;
@@ -892,17 +874,22 @@ static bool _trigger(struct pl330_thread *thrd)
892874
struct _arg_GO go;
893875
unsigned ns;
894876
u8 insn[6] = {0, 0, 0, 0, 0, 0};
877+
int idx;
895878

896879
/* Return if already ACTIVE */
897880
if (_state(thrd) != PL330_STATE_STOPPED)
898881
return true;
899882

900-
if (!IS_FREE(&thrd->req[1 - thrd->lstenq]))
901-
req = &thrd->req[1 - thrd->lstenq];
902-
else if (!IS_FREE(&thrd->req[thrd->lstenq]))
903-
req = &thrd->req[thrd->lstenq];
904-
else
905-
req = NULL;
883+
idx = 1 - thrd->lstenq;
884+
if (!IS_FREE(&thrd->req[idx]))
885+
req = &thrd->req[idx];
886+
else {
887+
idx = thrd->lstenq;
888+
if (!IS_FREE(&thrd->req[idx]))
889+
req = &thrd->req[idx];
890+
else
891+
req = NULL;
892+
}
906893

907894
/* Return if no request */
908895
if (!req || !req->r)
@@ -933,6 +920,8 @@ static bool _trigger(struct pl330_thread *thrd)
933920
/* Only manager can execute GO */
934921
_execute_DBGINSN(thrd, insn, true);
935922

923+
thrd->req_running = idx;
924+
936925
return true;
937926
}
938927

@@ -1382,8 +1371,8 @@ static void pl330_dotask(unsigned long data)
13821371

13831372
thrd->req[0].r = NULL;
13841373
thrd->req[1].r = NULL;
1385-
MARK_FREE(&thrd->req[0]);
1386-
MARK_FREE(&thrd->req[1]);
1374+
mark_free(thrd, 0);
1375+
mark_free(thrd, 1);
13871376

13881377
/* Clear the reset flag */
13891378
pl330->dmac_tbd.reset_chan &= ~(1 << i);
@@ -1461,14 +1450,12 @@ int pl330_update(const struct pl330_info *pi)
14611450

14621451
thrd = &pl330->channels[id];
14631452

1464-
active = _thrd_active(thrd);
1465-
if (!active) /* Aborted */
1453+
active = thrd->req_running;
1454+
if (active == -1) /* Aborted */
14661455
continue;
14671456

1468-
active -= 1;
1469-
14701457
rqdone = &thrd->req[active];
1471-
MARK_FREE(rqdone);
1458+
mark_free(thrd, active);
14721459

14731460
/* Get going again ASAP */
14741461
_start(thrd);
@@ -1509,7 +1496,7 @@ int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op)
15091496
struct pl330_thread *thrd = ch_id;
15101497
struct pl330_dmac *pl330;
15111498
unsigned long flags;
1512-
int ret = 0, active;
1499+
int ret = 0, active = thrd->req_running;
15131500

15141501
if (!thrd || thrd->free || thrd->dmac->state == DYING)
15151502
return -EINVAL;
@@ -1525,28 +1512,24 @@ int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op)
15251512

15261513
thrd->req[0].r = NULL;
15271514
thrd->req[1].r = NULL;
1528-
MARK_FREE(&thrd->req[0]);
1529-
MARK_FREE(&thrd->req[1]);
1515+
mark_free(thrd, 0);
1516+
mark_free(thrd, 1);
15301517
break;
15311518

15321519
case PL330_OP_ABORT:
1533-
active = _thrd_active(thrd);
1534-
15351520
/* Make sure the channel is stopped */
15361521
_stop(thrd);
15371522

15381523
/* ABORT is only for the active req */
1539-
if (!active)
1524+
if (active == -1)
15401525
break;
15411526

1542-
active--;
1543-
15441527
thrd->req[active].r = NULL;
1545-
MARK_FREE(&thrd->req[active]);
1528+
mark_free(thrd, active);
15461529

15471530
/* Start the next */
15481531
case PL330_OP_START:
1549-
if (!_thrd_active(thrd) && !_start(thrd))
1532+
if ((active == -1) && !_start(thrd))
15501533
ret = -EIO;
15511534
break;
15521535

@@ -1587,14 +1570,13 @@ int pl330_chan_status(void *ch_id, struct pl330_chanstatus *pstatus)
15871570
else
15881571
pstatus->faulting = false;
15891572

1590-
active = _thrd_active(thrd);
1573+
active = thrd->req_running;
15911574

1592-
if (!active) {
1575+
if (active == -1) {
15931576
/* Indicate that the thread is not running */
15941577
pstatus->top_req = NULL;
15951578
pstatus->wait_req = NULL;
15961579
} else {
1597-
active--;
15981580
pstatus->top_req = thrd->req[active].r;
15991581
pstatus->wait_req = !IS_FREE(&thrd->req[1 - active])
16001582
? thrd->req[1 - active].r : NULL;
@@ -1659,9 +1641,9 @@ void *pl330_request_channel(const struct pl330_info *pi)
16591641
thrd->free = false;
16601642
thrd->lstenq = 1;
16611643
thrd->req[0].r = NULL;
1662-
MARK_FREE(&thrd->req[0]);
1644+
mark_free(thrd, 0);
16631645
thrd->req[1].r = NULL;
1664-
MARK_FREE(&thrd->req[1]);
1646+
mark_free(thrd, 1);
16651647
break;
16661648
}
16671649
}
@@ -1767,14 +1749,14 @@ static inline void _reset_thread(struct pl330_thread *thrd)
17671749
thrd->req[0].mc_bus = pl330->mcode_bus
17681750
+ (thrd->id * pi->mcbufsz);
17691751
thrd->req[0].r = NULL;
1770-
MARK_FREE(&thrd->req[0]);
1752+
mark_free(thrd, 0);
17711753

17721754
thrd->req[1].mc_cpu = thrd->req[0].mc_cpu
17731755
+ pi->mcbufsz / 2;
17741756
thrd->req[1].mc_bus = thrd->req[0].mc_bus
17751757
+ pi->mcbufsz / 2;
17761758
thrd->req[1].r = NULL;
1777-
MARK_FREE(&thrd->req[1]);
1759+
mark_free(thrd, 1);
17781760
}
17791761

17801762
static int dmac_alloc_threads(struct pl330_dmac *pl330)

‎arch/arm/configs/imx_v4_v5_defconfig‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ CONFIG_ARCH_MXC=y
1818
CONFIG_ARCH_IMX_V4_V5=y
1919
CONFIG_ARCH_MX1ADS=y
2020
CONFIG_MACH_SCB9328=y
21+
CONFIG_MACH_APF9328=y
2122
CONFIG_MACH_MX21ADS=y
2223
CONFIG_MACH_MX25_3DS=y
23-
CONFIG_MACH_EUKREA_CPUIMX25=y
24+
CONFIG_MACH_EUKREA_CPUIMX25SD=y
2425
CONFIG_MACH_MX27ADS=y
2526
CONFIG_MACH_PCM038=y
2627
CONFIG_MACH_CPUIMX27=y
@@ -72,17 +73,16 @@ CONFIG_MTD_CFI_GEOMETRY=y
7273
CONFIG_MTD_CFI_INTELEXT=y
7374
CONFIG_MTD_PHYSMAP=y
7475
CONFIG_MTD_NAND=y
76+
CONFIG_MTD_NAND_MXC=y
7577
CONFIG_MTD_UBI=y
7678
CONFIG_MISC_DEVICES=y
7779
CONFIG_EEPROM_AT24=y
7880
CONFIG_EEPROM_AT25=y
7981
CONFIG_NETDEVICES=y
80-
CONFIG_NET_ETHERNET=y
81-
CONFIG_SMC91X=y
8282
CONFIG_DM9000=y
83+
CONFIG_SMC91X=y
8384
CONFIG_SMC911X=y
84-
# CONFIG_NETDEV_1000 is not set
85-
# CONFIG_NETDEV_10000 is not set
85+
CONFIG_SMSC_PHY=y
8686
# CONFIG_INPUT_MOUSEDEV is not set
8787
CONFIG_INPUT_EVDEV=y
8888
# CONFIG_INPUT_KEYBOARD is not set
@@ -100,6 +100,7 @@ CONFIG_I2C_CHARDEV=y
100100
CONFIG_I2C_IMX=y
101101
CONFIG_SPI=y
102102
CONFIG_SPI_IMX=y
103+
CONFIG_SPI_SPIDEV=y
103104
CONFIG_W1=y
104105
CONFIG_W1_MASTER_MXC=y
105106
CONFIG_W1_SLAVE_THERM=y
@@ -139,6 +140,7 @@ CONFIG_MMC=y
139140
CONFIG_MMC_MXC=y
140141
CONFIG_NEW_LEDS=y
141142
CONFIG_LEDS_CLASS=y
143+
CONFIG_LEDS_GPIO=y
142144
CONFIG_LEDS_MC13783=y
143145
CONFIG_LEDS_TRIGGERS=y
144146
CONFIG_LEDS_TRIGGER_TIMER=y

‎arch/arm/mach-exynos/cpu.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ static struct map_desc exynos4_iodesc[] __initdata = {
110110
.pfn = __phys_to_pfn(EXYNOS4_PA_DMC0),
111111
.length = SZ_4K,
112112
.type = MT_DEVICE,
113-
}, {
114-
.virtual = (unsigned long)S5P_VA_SROMC,
115-
.pfn = __phys_to_pfn(EXYNOS4_PA_SROMC),
116-
.length = SZ_4K,
117-
.type = MT_DEVICE,
118113
}, {
119114
.virtual = (unsigned long)S3C_VA_USB_HSPHY,
120115
.pfn = __phys_to_pfn(EXYNOS4_PA_HSPHY),

‎arch/arm/mach-imx/Kconfig‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ config MACH_MX25_3DS
132132
select IMX_HAVE_PLATFORM_MXC_NAND
133133
select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
134134

135-
config MACH_EUKREA_CPUIMX25
135+
config MACH_EUKREA_CPUIMX25SD
136136
bool "Support Eukrea CPUIMX25 Platform"
137137
select SOC_IMX25
138138
select IMX_HAVE_PLATFORM_FLEXCAN
@@ -148,7 +148,7 @@ config MACH_EUKREA_CPUIMX25
148148

149149
choice
150150
prompt "Baseboard"
151-
depends on MACH_EUKREA_CPUIMX25
151+
depends on MACH_EUKREA_CPUIMX25SD
152152
default MACH_EUKREA_MBIMXSD25_BASEBOARD
153153

154154
config MACH_EUKREA_MBIMXSD25_BASEBOARD
@@ -542,7 +542,7 @@ config MACH_MX35_3DS
542542
Include support for MX35PDK platform. This includes specific
543543
configurations for the board and its peripherals.
544544

545-
config MACH_EUKREA_CPUIMX35
545+
config MACH_EUKREA_CPUIMX35SD
546546
bool "Support Eukrea CPUIMX35 Platform"
547547
select SOC_IMX35
548548
select IMX_HAVE_PLATFORM_FLEXCAN
@@ -560,7 +560,7 @@ config MACH_EUKREA_CPUIMX35
560560

561561
choice
562562
prompt "Baseboard"
563-
depends on MACH_EUKREA_CPUIMX35
563+
depends on MACH_EUKREA_CPUIMX35SD
564564
default MACH_EUKREA_MBIMXSD35_BASEBOARD
565565

566566
config MACH_EUKREA_MBIMXSD35_BASEBOARD

‎arch/arm/mach-imx/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ obj-$(CONFIG_MACH_MX21ADS) += mach-mx21ads.o
2424

2525
# i.MX25 based machines
2626
obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o
27-
obj-$(CONFIG_MACH_EUKREA_CPUIMX25) += mach-eukrea_cpuimx25.o
27+
obj-$(CONFIG_MACH_EUKREA_CPUIMX25SD) += mach-eukrea_cpuimx25.o
2828
obj-$(CONFIG_MACH_EUKREA_MBIMXSD25_BASEBOARD) += eukrea_mbimxsd25-baseboard.o
2929

3030
# i.MX27 based machines
@@ -57,7 +57,7 @@ obj-$(CONFIG_MACH_BUG) += mach-bug.o
5757
# i.MX35 based machines
5858
obj-$(CONFIG_MACH_PCM043) += mach-pcm043.o
5959
obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35_3ds.o
60-
obj-$(CONFIG_MACH_EUKREA_CPUIMX35) += mach-cpuimx35.o
60+
obj-$(CONFIG_MACH_EUKREA_CPUIMX35SD) += mach-cpuimx35.o
6161
obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd35-baseboard.o
6262
obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o
6363

0 commit comments

Comments
 (0)