From 627634293ae7f4ec864cecd4282650ceae7a5067 Mon Sep 17 00:00:00 2001 From: Krzysztof Hałasa Date: Thu, 27 May 2010 12:40:17 +0200 Subject: IXP4xx: Prevent HSS transmitter lockup by disabling FRaMe signals. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With port configured with PCR_FRM_SYNC_OUTPUT* and external clock, bringing the hdlcX interface up and down without active clock supplied to the HSS causes a TX lockup. We don't support channelized/partial interfaces so FRaMe signals can't be used anyway, disabling them makes the lockup go away. Changes to this logic will be required if we want to support channelized HSS mode (this is most probably bug in NPE-A HSS firmware). Signed-off-by: Krzysztof Hałasa --- drivers/net/wan/ixp4xx_hss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c index 0c2cdde686a..31b0b4d1f57 100644 --- a/drivers/net/wan/ixp4xx_hss.c +++ b/drivers/net/wan/ixp4xx_hss.c @@ -396,7 +396,7 @@ static void hss_config(struct port *port) msg.cmd = PORT_CONFIG_WRITE; msg.hss_port = port->id; msg.index = HSS_CONFIG_TX_PCR; - msg.data32 = PCR_FRM_SYNC_OUTPUT_RISING | PCR_MSB_ENDIAN | + msg.data32 = PCR_FRM_PULSE_DISABLED | PCR_MSB_ENDIAN | PCR_TX_DATA_ENABLE | PCR_SOF_NO_FBIT; if (port->clock_type == CLOCK_INT) msg.data32 |= PCR_SYNC_CLK_DIR_OUTPUT; -- cgit v1.2.3-70-g09d2 From ce057297fdab808d9a071c084b7405bc6c8d14c5 Mon Sep 17 00:00:00 2001 From: Krzysztof Hałasa Date: Sun, 10 Jan 2010 14:20:10 +0100 Subject: IXP4xx: Fix ixp4xx_crypto little-endian operation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following on IXP425 little-endian: NPE-C: firmware functionality 0x5, revision 0x2:1 alg: skcipher: Test 1 failed on encryption for ecb(des)-ixp4xx 00000000: 01 23 45 67 89 ab cd e7 alg: skcipher: Test 1 failed on encryption for ecb(des3_ede)-ixp4xx 00000000: 73 6f 6d 65 64 61 74 61 alg: skcipher: Test 1 failed on encryption for ecb(aes)-ixp4xx 00000000: 00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff Signed-off-by: Krzysztof Hałasa Acked-by: Christian Hohnstaedt --- drivers/crypto/ixp4xx_crypto.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'drivers') diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index f17ddf37a1e..0d662213c06 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c @@ -97,8 +97,13 @@ struct buffer_desc { u32 phys_next; +#ifdef __ARMEB__ u16 buf_len; u16 pkt_len; +#else + u16 pkt_len; + u16 buf_len; +#endif u32 phys_addr; u32 __reserved[4]; struct buffer_desc *next; @@ -106,17 +111,30 @@ struct buffer_desc { }; struct crypt_ctl { +#ifdef __ARMEB__ u8 mode; /* NPE_OP_* operation mode */ u8 init_len; u16 reserved; +#else + u16 reserved; + u8 init_len; + u8 mode; /* NPE_OP_* operation mode */ +#endif u8 iv[MAX_IVLEN]; /* IV for CBC mode or CTR IV for CTR mode */ u32 icv_rev_aes; /* icv or rev aes */ u32 src_buf; u32 dst_buf; +#ifdef __ARMEB__ u16 auth_offs; /* Authentication start offset */ u16 auth_len; /* Authentication data length */ u16 crypt_offs; /* Cryption start offset */ u16 crypt_len; /* Cryption data length */ +#else + u16 auth_len; /* Authentication data length */ + u16 auth_offs; /* Authentication start offset */ + u16 crypt_len; /* Cryption data length */ + u16 crypt_offs; /* Cryption start offset */ +#endif u32 aadAddr; /* Additional Auth Data Addr for CCM mode */ u32 crypto_ctx; /* NPE Crypto Param structure address */ @@ -652,6 +670,9 @@ static int setup_auth(struct crypto_tfm *tfm, int encrypt, unsigned authsize, /* write cfg word to cryptinfo */ cfgword = algo->cfgword | ( authsize << 6); /* (authsize/4) << 8 */ +#ifndef __ARMEB__ + cfgword ^= 0xAA000000; /* change the "byte swap" flags */ +#endif *(u32*)cinfo = cpu_to_be32(cfgword); cinfo += sizeof(cfgword); -- cgit v1.2.3-70-g09d2 From 0409cb0dacb58c8796ab9a5ec1be9550c7bc8553 Mon Sep 17 00:00:00 2001 From: Krzysztof Hałasa Date: Sun, 10 Jan 2010 13:56:13 +0100 Subject: IXP4xx: Make mdio_bus struct static in the Ethernet driver. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krzysztof Hałasa --- drivers/net/arm/ixp4xx_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c index 6be8b098b8b..656e2ae3228 100644 --- a/drivers/net/arm/ixp4xx_eth.c +++ b/drivers/net/arm/ixp4xx_eth.c @@ -241,7 +241,7 @@ static inline void memcpy_swab32(u32 *dest, u32 *src, int cnt) static spinlock_t mdio_lock; static struct eth_regs __iomem *mdio_regs; /* mdio command and status only */ -struct mii_bus *mdio_bus; +static struct mii_bus *mdio_bus; static int ports_open; static struct port *npe_port_tab[MAX_NPES]; static struct dma_pool *dma_pool; -- cgit v1.2.3-70-g09d2