Skip to content

Commit 90bf80a

Browse files
committed
Merge tag 'ixp4xx-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM ixp4xx bug fixes from Arnd Bergmann: "These were originally prepared by Krzysztof Halasa but not submitted in time for v3.7 due to some confusion about how ixp4xx patches should be handled. Jason Cooper thankfully offered to help out sending the patches upstream through arm-soc now, but given the timing, we could as well delay them for 3.8." * tag 'ixp4xx-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: IXP4xx: use __iomem for MMIO IXP4xx: map CPU config registers within VMALLOC region. IXP4xx: Always ioremap() Queue Manager MMIO region at boot. ixp4xx: Declare MODULE_FIRMWARE usage IXP4xx crypto: MOD_AES{128,192,256} already include key size. WAN: Remove redundant HDLC info printed by IXP4xx HSS driver. IXP4xx: Remove time limit for PCI TRDY to enable use of slow devices. IXP4xx: ixp4xx_crypto driver requires Queue Manager and NPE drivers. IXP4xx: HW pseudo-random generator is available on IXP45x/46x only. IXP4xx: Fix off-by-one bug in Goramo MultiLink platform. IXP4xx: Fix Goramo MultiLink platform compilation.
2 parents 50a561c + 0d2c9f0 commit 90bf80a

File tree

13 files changed

+59
-68
lines changed

13 files changed

+59
-68
lines changed

arch/arm/mach-ixp4xx/common-pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ void __init ixp4xx_pci_preinit(void)
410410
* Enable the IO window to be way up high, at 0xfffffc00
411411
*/
412412
local_write_config(PCI_BASE_ADDRESS_5, 4, 0xfffffc01);
413+
local_write_config(0x40, 4, 0x000080FF); /* No TRDY time limit */
413414
} else {
414415
printk("PCI: IXP4xx is target - No bus scan performed\n");
415416
}

arch/arm/mach-ixp4xx/common.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,12 @@ static struct map_desc ixp4xx_io_desc[] __initdata = {
6767
.pfn = __phys_to_pfn(IXP4XX_PCI_CFG_BASE_PHYS),
6868
.length = IXP4XX_PCI_CFG_REGION_SIZE,
6969
.type = MT_DEVICE
70-
},
71-
#ifdef CONFIG_DEBUG_LL
72-
{ /* Debug UART mapping */
73-
.virtual = (unsigned long)IXP4XX_DEBUG_UART_BASE_VIRT,
74-
.pfn = __phys_to_pfn(IXP4XX_DEBUG_UART_BASE_PHYS),
75-
.length = IXP4XX_DEBUG_UART_REGION_SIZE,
70+
}, { /* Queue Manager */
71+
.virtual = (unsigned long)IXP4XX_QMGR_BASE_VIRT,
72+
.pfn = __phys_to_pfn(IXP4XX_QMGR_BASE_PHYS),
73+
.length = IXP4XX_QMGR_REGION_SIZE,
7674
.type = MT_DEVICE
77-
}
78-
#endif
75+
},
7976
};
8077

8178
void __init ixp4xx_map_io(void)

arch/arm/mach-ixp4xx/goramo_mlr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <asm/mach/arch.h>
1616
#include <asm/mach/flash.h>
1717
#include <asm/mach/pci.h>
18+
#include <asm/system_info.h>
1819

1920
#define SLOT_ETHA 0x0B /* IDSEL = AD21 */
2021
#define SLOT_ETHB 0x0C /* IDSEL = AD20 */
@@ -329,7 +330,7 @@ static struct platform_device device_hss_tab[] = {
329330
};
330331

331332

332-
static struct platform_device *device_tab[6] __initdata = {
333+
static struct platform_device *device_tab[7] __initdata = {
333334
&device_flash, /* index 0 */
334335
};
335336

arch/arm/mach-ixp4xx/include/mach/debug-macro.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#else
1818
mov \rp, #0
1919
#endif
20-
orr \rv, \rp, #0xff000000 @ virtual
21-
orr \rv, \rv, #0x00b00000
20+
orr \rv, \rp, #0xfe000000 @ virtual
21+
orr \rv, \rv, #0x00f00000
2222
orr \rp, \rp, #0xc8000000 @ physical
2323
.endm
2424

arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,51 +30,43 @@
3030
*
3131
* 0x50000000 0x10000000 ioremap'd EXP BUS
3232
*
33-
* 0x6000000 0x00004000 ioremap'd QMgr
33+
* 0xC8000000 0x00013000 0xFEF00000 On-Chip Peripherals
3434
*
35-
* 0xC0000000 0x00001000 0xffbff000 PCI CFG
35+
* 0xC0000000 0x00001000 0xFEF13000 PCI CFG
3636
*
37-
* 0xC4000000 0x00001000 0xffbfe000 EXP CFG
37+
* 0xC4000000 0x00001000 0xFEF14000 EXP CFG
3838
*
39-
* 0xC8000000 0x00013000 0xffbeb000 On-Chip Peripherals
39+
* 0x60000000 0x00004000 0xFEF15000 QMgr
4040
*/
4141

4242
/*
4343
* Queue Manager
4444
*/
45-
#define IXP4XX_QMGR_BASE_PHYS (0x60000000)
46-
#define IXP4XX_QMGR_REGION_SIZE (0x00004000)
45+
#define IXP4XX_QMGR_BASE_PHYS 0x60000000
46+
#define IXP4XX_QMGR_BASE_VIRT IOMEM(0xFEF15000)
47+
#define IXP4XX_QMGR_REGION_SIZE 0x00004000
4748

4849
/*
49-
* Expansion BUS Configuration registers
50+
* Peripheral space, including debug UART. Must be section-aligned so that
51+
* it can be used with the low-level debug code.
5052
*/
51-
#define IXP4XX_EXP_CFG_BASE_PHYS (0xC4000000)
52-
#define IXP4XX_EXP_CFG_BASE_VIRT IOMEM(0xFFBFE000)
53-
#define IXP4XX_EXP_CFG_REGION_SIZE (0x00001000)
53+
#define IXP4XX_PERIPHERAL_BASE_PHYS 0xC8000000
54+
#define IXP4XX_PERIPHERAL_BASE_VIRT IOMEM(0xFEF00000)
55+
#define IXP4XX_PERIPHERAL_REGION_SIZE 0x00013000
5456

5557
/*
5658
* PCI Config registers
5759
*/
58-
#define IXP4XX_PCI_CFG_BASE_PHYS (0xC0000000)
59-
#define IXP4XX_PCI_CFG_BASE_VIRT IOMEM(0xFFBFF000)
60-
#define IXP4XX_PCI_CFG_REGION_SIZE (0x00001000)
61-
62-
/*
63-
* Peripheral space
64-
*/
65-
#define IXP4XX_PERIPHERAL_BASE_PHYS (0xC8000000)
66-
#define IXP4XX_PERIPHERAL_BASE_VIRT IOMEM(0xFFBEB000)
67-
#define IXP4XX_PERIPHERAL_REGION_SIZE (0x00013000)
60+
#define IXP4XX_PCI_CFG_BASE_PHYS 0xC0000000
61+
#define IXP4XX_PCI_CFG_BASE_VIRT IOMEM(0xFEF13000)
62+
#define IXP4XX_PCI_CFG_REGION_SIZE 0x00001000
6863

6964
/*
70-
* Debug UART
71-
*
72-
* This is basically a remap of UART1 into a region that is section
73-
* aligned so that it * can be used with the low-level debug code.
65+
* Expansion BUS Configuration registers
7466
*/
75-
#define IXP4XX_DEBUG_UART_BASE_PHYS (0xC8000000)
76-
#define IXP4XX_DEBUG_UART_BASE_VIRT IOMEM(0xffb00000)
77-
#define IXP4XX_DEBUG_UART_REGION_SIZE (0x00001000)
67+
#define IXP4XX_EXP_CFG_BASE_PHYS 0xC4000000
68+
#define IXP4XX_EXP_CFG_BASE_VIRT 0xFEF14000
69+
#define IXP4XX_EXP_CFG_REGION_SIZE 0x00001000
7870

7971
#define IXP4XX_EXP_CS0_OFFSET 0x00
8072
#define IXP4XX_EXP_CS1_OFFSET 0x04

arch/arm/mach-ixp4xx/include/mach/qmgr.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void qmgr_release_queue(unsigned int queue);
8686

8787
static inline void qmgr_put_entry(unsigned int queue, u32 val)
8888
{
89-
extern struct qmgr_regs __iomem *qmgr_regs;
89+
struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
9090
#if DEBUG_QMGR
9191
BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */
9292

@@ -99,7 +99,7 @@ static inline void qmgr_put_entry(unsigned int queue, u32 val)
9999
static inline u32 qmgr_get_entry(unsigned int queue)
100100
{
101101
u32 val;
102-
extern struct qmgr_regs __iomem *qmgr_regs;
102+
const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
103103
val = __raw_readl(&qmgr_regs->acc[queue][0]);
104104
#if DEBUG_QMGR
105105
BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */
@@ -112,14 +112,14 @@ static inline u32 qmgr_get_entry(unsigned int queue)
112112

113113
static inline int __qmgr_get_stat1(unsigned int queue)
114114
{
115-
extern struct qmgr_regs __iomem *qmgr_regs;
115+
const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
116116
return (__raw_readl(&qmgr_regs->stat1[queue >> 3])
117117
>> ((queue & 7) << 2)) & 0xF;
118118
}
119119

120120
static inline int __qmgr_get_stat2(unsigned int queue)
121121
{
122-
extern struct qmgr_regs __iomem *qmgr_regs;
122+
const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
123123
BUG_ON(queue >= HALF_QUEUES);
124124
return (__raw_readl(&qmgr_regs->stat2[queue >> 4])
125125
>> ((queue & 0xF) << 1)) & 0x3;
@@ -145,7 +145,7 @@ static inline int qmgr_stat_empty(unsigned int queue)
145145
*/
146146
static inline int qmgr_stat_below_low_watermark(unsigned int queue)
147147
{
148-
extern struct qmgr_regs __iomem *qmgr_regs;
148+
const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
149149
if (queue >= HALF_QUEUES)
150150
return (__raw_readl(&qmgr_regs->statne_h) >>
151151
(queue - HALF_QUEUES)) & 0x01;
@@ -172,7 +172,7 @@ static inline int qmgr_stat_above_high_watermark(unsigned int queue)
172172
*/
173173
static inline int qmgr_stat_full(unsigned int queue)
174174
{
175-
extern struct qmgr_regs __iomem *qmgr_regs;
175+
const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
176176
if (queue >= HALF_QUEUES)
177177
return (__raw_readl(&qmgr_regs->statf_h) >>
178178
(queue - HALF_QUEUES)) & 0x01;

arch/arm/mach-ixp4xx/ixp4xx_npe.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@
116116
/* NPE mailbox_status value for reset */
117117
#define RESET_MBOX_STAT 0x0000F0F0
118118

119-
const char *npe_names[] = { "NPE-A", "NPE-B", "NPE-C" };
119+
#define NPE_A_FIRMWARE "NPE-A"
120+
#define NPE_B_FIRMWARE "NPE-B"
121+
#define NPE_C_FIRMWARE "NPE-C"
122+
123+
const char *npe_names[] = { NPE_A_FIRMWARE, NPE_B_FIRMWARE, NPE_C_FIRMWARE };
120124

121125
#define print_npe(pri, npe, fmt, ...) \
122126
printk(pri "%s: " fmt, npe_name(npe), ## __VA_ARGS__)
@@ -724,6 +728,9 @@ module_exit(npe_cleanup_module);
724728

725729
MODULE_AUTHOR("Krzysztof Halasa");
726730
MODULE_LICENSE("GPL v2");
731+
MODULE_FIRMWARE(NPE_A_FIRMWARE);
732+
MODULE_FIRMWARE(NPE_B_FIRMWARE);
733+
MODULE_FIRMWARE(NPE_C_FIRMWARE);
727734

728735
EXPORT_SYMBOL(npe_names);
729736
EXPORT_SYMBOL(npe_running);

arch/arm/mach-ixp4xx/ixp4xx_qmgr.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <linux/module.h>
1515
#include <mach/qmgr.h>
1616

17-
struct qmgr_regs __iomem *qmgr_regs;
17+
static struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
1818
static struct resource *mem_res;
1919
static spinlock_t qmgr_lock;
2020
static u32 used_sram_bitmap[4]; /* 128 16-dword pages */
@@ -293,12 +293,6 @@ static int qmgr_init(void)
293293
if (mem_res == NULL)
294294
return -EBUSY;
295295

296-
qmgr_regs = ioremap(IXP4XX_QMGR_BASE_PHYS, IXP4XX_QMGR_REGION_SIZE);
297-
if (qmgr_regs == NULL) {
298-
err = -ENOMEM;
299-
goto error_map;
300-
}
301-
302296
/* reset qmgr registers */
303297
for (i = 0; i < 4; i++) {
304298
__raw_writel(0x33333333, &qmgr_regs->stat1[i]);
@@ -347,8 +341,6 @@ static int qmgr_init(void)
347341
error_irq2:
348342
free_irq(IRQ_IXP4XX_QM1, NULL);
349343
error_irq:
350-
iounmap(qmgr_regs);
351-
error_map:
352344
release_mem_region(IXP4XX_QMGR_BASE_PHYS, IXP4XX_QMGR_REGION_SIZE);
353345
return err;
354346
}
@@ -359,7 +351,6 @@ static void qmgr_remove(void)
359351
free_irq(IRQ_IXP4XX_QM2, NULL);
360352
synchronize_irq(IRQ_IXP4XX_QM1);
361353
synchronize_irq(IRQ_IXP4XX_QM2);
362-
iounmap(qmgr_regs);
363354
release_mem_region(IXP4XX_QMGR_BASE_PHYS, IXP4XX_QMGR_REGION_SIZE);
364355
}
365356

@@ -369,7 +360,6 @@ module_exit(qmgr_remove);
369360
MODULE_LICENSE("GPL v2");
370361
MODULE_AUTHOR("Krzysztof Halasa");
371362

372-
EXPORT_SYMBOL(qmgr_regs);
373363
EXPORT_SYMBOL(qmgr_set_irq);
374364
EXPORT_SYMBOL(qmgr_enable_irq);
375365
EXPORT_SYMBOL(qmgr_disable_irq);

drivers/char/hw_random/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ config HW_RANDOM_VIA
127127
If unsure, say Y.
128128

129129
config HW_RANDOM_IXP4XX
130-
tristate "Intel IXP4xx NPU HW Random Number Generator support"
130+
tristate "Intel IXP4xx NPU HW Pseudo-Random Number Generator support"
131131
depends on HW_RANDOM && ARCH_IXP4XX
132132
default HW_RANDOM
133133
---help---
134-
This driver provides kernel-side support for the Random
135-
Number Generator hardware found on the Intel IXP4xx NPU.
134+
This driver provides kernel-side support for the Pseudo-Random
135+
Number Generator hardware found on the Intel IXP45x/46x NPU.
136136

137137
To compile this driver as a module, choose M here: the
138138
module will be called ixp4xx-rng.

drivers/char/hw_random/ixp4xx-rng.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ static int __init ixp4xx_rng_init(void)
4545
void __iomem * rng_base;
4646
int err;
4747

48+
if (!cpu_is_ixp46x()) /* includes IXP455 */
49+
return -ENOSYS;
50+
4851
rng_base = ioremap(0x70002100, 4);
4952
if (!rng_base)
5053
return -ENOMEM;
@@ -68,5 +71,5 @@ module_init(ixp4xx_rng_init);
6871
module_exit(ixp4xx_rng_exit);
6972

7073
MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>");
71-
MODULE_DESCRIPTION("H/W Random Number Generator (RNG) driver for IXP4xx");
74+
MODULE_DESCRIPTION("H/W Pseudo-Random Number Generator (RNG) driver for IXP45x/46x");
7275
MODULE_LICENSE("GPL");

drivers/crypto/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ config CRYPTO_DEV_TALITOS
224224

225225
config CRYPTO_DEV_IXP4XX
226226
tristate "Driver for IXP4xx crypto hardware acceleration"
227-
depends on ARCH_IXP4XX
227+
depends on ARCH_IXP4XX && IXP4XX_QMGR && IXP4XX_NPE
228228
select CRYPTO_DES
229229
select CRYPTO_ALGAPI
230230
select CRYPTO_AUTHENC

drivers/crypto/ixp4xx_crypto.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -750,12 +750,12 @@ static int setup_cipher(struct crypto_tfm *tfm, int encrypt,
750750
}
751751
if (cipher_cfg & MOD_AES) {
752752
switch (key_len) {
753-
case 16: keylen_cfg = MOD_AES128 | KEYLEN_128; break;
754-
case 24: keylen_cfg = MOD_AES192 | KEYLEN_192; break;
755-
case 32: keylen_cfg = MOD_AES256 | KEYLEN_256; break;
756-
default:
757-
*flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
758-
return -EINVAL;
753+
case 16: keylen_cfg = MOD_AES128; break;
754+
case 24: keylen_cfg = MOD_AES192; break;
755+
case 32: keylen_cfg = MOD_AES256; break;
756+
default:
757+
*flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
758+
return -EINVAL;
759759
}
760760
cipher_cfg |= keylen_cfg;
761761
} else if (cipher_cfg & MOD_3DES) {

drivers/net/wan/ixp4xx_hss.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,7 @@ static int __devinit hss_init_one(struct platform_device *pdev)
13651365

13661366
platform_set_drvdata(pdev, port);
13671367

1368-
netdev_info(dev, "HSS-%i\n", port->id);
1368+
netdev_info(dev, "initialized\n");
13691369
return 0;
13701370

13711371
err_free_netdev:

0 commit comments

Comments
 (0)