Fixes for running a big-endian kernel on Cubieboard2
Subsystems (8)
v3 cover Fixes for running a big-endian kernel on Cubieboard2
Hello,
the following patches fix up endianness problems with DMA descriptors in the sunxi-mmc and stmmac drivers preventing a big-endian kernel from working correctly on the Cubieboard2.
The third patch adds the ability to enable diagnostic messages in the sun4i-emac driver which were instrumental in finding the problem fixed by patch number four: Endianness confusion caused by dual-purpose I/O register usage in sun4i-emac.
The final patch enables the big-endian kernel configuration option for sunxi devices in order to be able to compile a big-endian kernel for the Cubieboard2. All of these have been tested successfull on a Cubieboard2 DualCard.
Changes since v2:
- Fixed typo in stmmac patch causing a build failure
- Added sun4i-emac patches
Changes since v1:
- Fixed checkpatch niggles
- Added respective Cc:s
Regards,
Michael
PATCH v3 1/5 mmc: sunxi-mmc: change idma descriptor to __le32
The sunxi-mmc driver does not take into account the processor may be big endian when writing the DMA descriptors. This causes cards not to be detected when running a big-endian kernel. Change the descriptors for IDMA to use __le32 and ensure they are suitably swapped before writing. Tested successfully on the Cubieboard2.
--- drivers/mmc/host/sunxi-mmc.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
drivers/mmc/host/sunxi-mmc.c +15 -12
@@ -223,10 +223,10 @@ struct sunxi_mmc_clk_delay { };struct sunxi_idma_des { -u32 config; -u32 buf_size; -u32 buf_addr_ptr1; -u32 buf_addr_ptr2; +__le32 config; +__le32 buf_size; +__le32 buf_addr_ptr1; +__le32 buf_addr_ptr2; };struct sunxi_mmc_host {
@@ -325,22 +325,25 @@ static void sunxi_mmc_init_idma_des(struct sunxi_mmc_host *host,int i, max_len = (1 << host->idma_des_size_bits);for (i =0 ; i < data->sg_len; i++) { - pdes[i].config =SDXC_IDMAC_DES0_CH |SDXC_IDMAC_DES0_OWN | -SDXC_IDMAC_DES0_DIC ; + pdes[i].config =cpu_to_le32 (SDXC_IDMAC_DES0_CH | +SDXC_IDMAC_DES0_OWN | +SDXC_IDMAC_DES0_DIC );if (data->sg[i].length == max_len) pdes[i].buf_size =0 ;/* 0 == max_len */ else - pdes[i].buf_size = data->sg[i].length; + pdes[i].buf_size =cpu_to_le32 (data->sg[i].length); next_desc +=sizeof (struct sunxi_idma_des ); - pdes[i].buf_addr_ptr1 =sg_dma_address (&data->sg[i]); - pdes[i].buf_addr_ptr2 = (u32 )next_desc; + pdes[i].buf_addr_ptr1 = +cpu_to_le32 (sg_dma_address (&data->sg[i])); + pdes[i].buf_addr_ptr2 =cpu_to_le32 ((u32 )next_desc); } - pdes[0 ].config |=SDXC_IDMAC_DES0_FD ; - pdes[i -1 ].config |=SDXC_IDMAC_DES0_LD |SDXC_IDMAC_DES0_ER ; - pdes[i -1 ].config &= ~SDXC_IDMAC_DES0_DIC ; + pdes[0 ].config |=cpu_to_le32 (SDXC_IDMAC_DES0_FD ); + pdes[i -1 ].config |=cpu_to_le32 (SDXC_IDMAC_DES0_LD | +SDXC_IDMAC_DES0_ER ); + pdes[i -1 ].config &=cpu_to_le32 (~SDXC_IDMAC_DES0_DIC ); pdes[i -1 ].buf_addr_ptr2 =0 ;/*
Signature · 1 line
2.9.2
PATCH 1/5 mmc: sunxi-mmc: change idma descriptor to __le32
Quoted 8 lines · Michael Weiser
The sunxi-mmc driver does not take into account the processor may be big endian when writing the DMA descriptors. This causes cards not to be detected when running a big-endian kernel. Change the descriptors for IDMA to use
__le32and ensure they are suitably swapped before writing. Tested successfully on the Cubieboard2.Signed-off-by Michael Weiser <[email protected]>Acked-by Maxime Ripard <[email protected]>
This doesn't apply as I have queued some other sunxi changes. Could you please re-spin a new version.
Kind regards
Uffe
Quoted 63 lines
Cc Ulf Hansson <[email protected]>Cc Chen-Yu Tsai <[email protected]>Cc linux-mmc at vger.kernel.org--- drivers/mmc/host/sunxi-mmc.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)drivers/mmc/host/sunxi-mmc.c +15
-13@@ -223,10 +223,10 @@ struct sunxi_mmc_clk_delay { };struct sunxi_idma_des { -u32 config; -u32 buf_size; -u32 buf_addr_ptr1; -u32 buf_addr_ptr2; +__le32 config; +__le32 buf_size; +__le32 buf_addr_ptr1; +__le32 buf_addr_ptr2; };struct sunxi_mmc_host {@@ -325,22 +325,25 @@ static void sunxi_mmc_init_idma_des(struct sunxi_mmc_host *host,int i, max_len = (1 << host->idma_des_size_bits);for (i =0 ; i < data->sg_len; i++) { - pdes[i].config =SDXC_IDMAC_DES0_CH |SDXC_IDMAC_DES0_OWN | -SDXC_IDMAC_DES0_DIC ; + pdes[i].config =cpu_to_le32 (SDXC_IDMAC_DES0_CH | +SDXC_IDMAC_DES0_OWN | +SDXC_IDMAC_DES0_DIC );if (data->sg[i].length == max_len) pdes[i].buf_size =0 ;/* 0 == max_len */ else - pdes[i].buf_size = data->sg[i].length; + pdes[i].buf_size =cpu_to_le32 (data->sg[i].length); next_desc +=sizeof (struct sunxi_idma_des ); - pdes[i].buf_addr_ptr1 =sg_dma_address (&data->sg[i]); - pdes[i].buf_addr_ptr2 = (u32 )next_desc; + pdes[i].buf_addr_ptr1 = +cpu_to_le32 (sg_dma_address (&data->sg[i])); + pdes[i].buf_addr_ptr2 =cpu_to_le32 ((u32 )next_desc); } - pdes[0 ].config |=SDXC_IDMAC_DES0_FD ; - pdes[i -1 ].config |=SDXC_IDMAC_DES0_LD |SDXC_IDMAC_DES0_ER ; - pdes[i -1 ].config &= ~SDXC_IDMAC_DES0_DIC ; + pdes[0 ].config |=cpu_to_le32 (SDXC_IDMAC_DES0_FD ); + pdes[i -1 ].config |=cpu_to_le32 (SDXC_IDMAC_DES0_LD | +SDXC_IDMAC_DES0_ER ); + pdes[i -1 ].config &=cpu_to_le32 (~SDXC_IDMAC_DES0_DIC ); pdes[i -1 ].buf_addr_ptr2 =0 ;/* -- 2.9.2
PATCH v3 2/5 net: ethernet: stmmac: change dma descriptors to __le32
In reply to Michael WeiserThe stmmac driver does not take into account the processor may be big endian when writing the DMA descriptors. This causes the ethernet interface not to be initialised correctly when running a big-endian kernel. Change the descriptors for DMA to use __le32 and ensure they are suitably swapped before writing. Tested successfully on the Cubieboard2.
--- drivers/net/ethernet/stmicro/stmmac/chain_mode.c | 55 ++++++++++---------- drivers/net/ethernet/stmicro/stmmac/descs.h | 20 ++++---- drivers/net/ethernet/stmicro/stmmac/descs_com.h | 48 +++++++++-------- drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c | 60 +++++++++++----------- drivers/net/ethernet/stmicro/stmmac/enh_desc.c | 55 ++++++++++---------- drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 48 ++++++++--------- drivers/net/ethernet/stmicro/stmmac/ring_mode.c | 39 +++++++------- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 51 +++++++++--------- 8 files changed, 195 insertions(+), 181 deletions(-)
drivers/net/ethernet/stmicro/stmmac/chain_mode.c +29 -26
@@ -34,7 +34,7 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum)unsigned int entry = priv->cur_tx;struct dma_desc *desc = priv->dma_tx + entry;unsigned int nopaged_len =skb_headlen (skb); -unsigned int bmax; +unsigned int bmax, des2;unsigned int i =1 , len;if (priv->plat->enh_desc)
@@ -44,11 +44,12 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) len = nopaged_len - bmax; - desc->des2 =dma_map_single (priv->device, skb->data, - bmax,DMA_TO_DEVICE ); -if (dma_mapping_error (priv->device, desc->des2)) + des2 =dma_map_single (priv->device, skb->data, + bmax,DMA_TO_DEVICE ); + desc->des2 =cpu_to_le32 (des2); +if (dma_mapping_error (priv->device, des2))return -1 ; - priv->tx_skbuff_dma[entry].buf = desc->des2; + priv->tx_skbuff_dma[entry].buf = des2; priv->tx_skbuff_dma[entry].len = bmax;/* do not close the descriptor and do not set own bit */ priv->hw->desc->prepare_tx_desc(desc, 1, bmax, csum, STMMAC_CHAIN_MODE,
@@ -60,12 +61,13 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) desc = priv->dma_tx + entry;if (len > bmax) { - desc->des2 =dma_map_single (priv->device, - (skb->data + bmax * i), - bmax,DMA_TO_DEVICE ); -if (dma_mapping_error (priv->device, desc->des2)) + des2 =dma_map_single (priv->device, + (skb->data + bmax * i), + bmax,DMA_TO_DEVICE ); + desc->des2 =cpu_to_le32 (des2); +if (dma_mapping_error (priv->device, des2))return -1 ; - priv->tx_skbuff_dma[entry].buf = desc->des2; + priv->tx_skbuff_dma[entry].buf = des2; priv->tx_skbuff_dma[entry].len = bmax; priv->hw->desc->prepare_tx_desc(desc, 0, bmax, csum, STMMAC_CHAIN_MODE, 1,
@@ -73,12 +75,13 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) len -= bmax; i++; }else { - desc->des2 =dma_map_single (priv->device, - (skb->data + bmax * i), len, -DMA_TO_DEVICE ); -if (dma_mapping_error (priv->device, desc->des2)) + des2 =dma_map_single (priv->device, + (skb->data + bmax * i), len, +DMA_TO_DEVICE ); + desc->des2 =cpu_to_le32 (des2); +if (dma_mapping_error (priv->device, des2))return -1 ; - priv->tx_skbuff_dma[entry].buf = desc->des2; + priv->tx_skbuff_dma[entry].buf = des2; priv->tx_skbuff_dma[entry].len = len;/* last descriptor can be set now */ priv->hw->desc->prepare_tx_desc(desc, 0, len, csum,
@@ -119,19 +122,19 @@ static void stmmac_init_dma_chain(void *des, dma_addr_t phy_addr,struct dma_extended_desc *p = (struct dma_extended_desc *)des;for (i =0 ; i < (size -1 ); i++) { dma_phy +=sizeof (struct dma_extended_desc ); - p->basic.des3 = (unsigned int )dma_phy; + p->basic.des3 =cpu_to_le32 ((unsigned int )dma_phy); p++; } - p->basic.des3 = (unsigned int )phy_addr; + p->basic.des3 =cpu_to_le32 ((unsigned int )phy_addr); }else {struct dma_desc *p = (struct dma_desc *)des;for (i =0 ; i < (size -1 ); i++) { dma_phy +=sizeof (struct dma_desc ); - p->des3 = (unsigned int )dma_phy; + p->des3 =cpu_to_le32 ((unsigned int )dma_phy); p++; } - p->des3 = (unsigned int )phy_addr; + p->des3 =cpu_to_le32 ((unsigned int )phy_addr); } }
@@ -144,10 +147,10 @@ static void stmmac_refill_desc3(void *priv_ptr, struct dma_desc *p)* 1588-2002 time stamping is enabled, hence reinitialize it * to keep explicit chaining in the descriptor. */ - p->des3 = (unsigned int )(priv->dma_rx_phy + - (((priv->dirty_rx) +1 ) % -DMA_RX_SIZE ) * -sizeof (struct dma_desc )); + p->des3 =cpu_to_le32 ((unsigned int )(priv->dma_rx_phy + + (((priv->dirty_rx) +1 ) % +DMA_RX_SIZE ) * +sizeof (struct dma_desc ))); }static void stmmac_clean_desc3 (void *priv_ptr,struct dma_desc *p)
@@ -161,9 +164,9 @@ static void stmmac_clean_desc3(void *priv_ptr, struct dma_desc *p)* 1588-2002 time stamping is enabled, hence reinitialize it * to keep explicit chaining in the descriptor. */ - p->des3 = (unsigned int )((priv->dma_tx_phy + - ((priv->dirty_tx +1 ) %DMA_TX_SIZE )) - *sizeof (struct dma_desc )); + p->des3 =cpu_to_le32 ((unsigned int )((priv->dma_tx_phy + + ((priv->dirty_tx +1 ) %DMA_TX_SIZE )) + *sizeof (struct dma_desc ))); }const struct stmmac_mode_ops chain_mode_ops = {
drivers/net/ethernet/stmicro/stmmac/descs.h +10 -10
@@ -87,7 +87,7 @@#define TDES0_ERROR_SUMMARY BIT(15)#define TDES0_IP_HEADER_ERROR BIT(16)#define TDES0_TIME_STAMP_STATUS BIT(17) -#define TDES0_OWN BIT(31) +#define TDES0_OWN ((u32)BIT(31))/* silence sparse */ /* TDES1 */ #define TDES1_BUFFER1_SIZE_MASK GENMASK(10, 0)#define TDES1_BUFFER2_SIZE_MASK GENMASK(21, 11)
@@ -130,7 +130,7 @@#define ETDES0_FIRST_SEGMENT BIT(28)#define ETDES0_LAST_SEGMENT BIT(29)#define ETDES0_INTERRUPT BIT(30) -#define ETDES0_OWN BIT(31) +#define ETDES0_OWN ((u32)BIT(31))/* silence sparse */ /* TDES1 */ #define ETDES1_BUFFER1_SIZE_MASK GENMASK(12, 0)#define ETDES1_BUFFER2_SIZE_MASK GENMASK(28, 16)
@@ -166,19 +166,19 @@/* Basic descriptor structure for normal and alternate descriptors */ struct dma_desc { -unsigned int des0; -unsigned int des1; -unsigned int des2; -unsigned int des3; +__le32 des0; +__le32 des1; +__le32 des2; +__le32 des3; };/* Extended descriptor structure (e.g. >= databook 3.50a) */ struct dma_extended_desc {struct dma_desc basic;/* Basic descriptors */ -unsigned int des4;/* Extended Status */ -unsigned int des5;/* Reserved */ -unsigned int des6;/* Tx/Rx Timestamp Low */ -unsigned int des7;/* Tx/Rx Timestamp High */ +__le32 des4;/* Extended Status */ +__le32 des5;/* Reserved */ +__le32 des6;/* Tx/Rx Timestamp Low */ +__le32 des7;/* Tx/Rx Timestamp High */ };/* Transmit checksum insertion control */
drivers/net/ethernet/stmicro/stmmac/descs_com.h +26 -22
115 lines not on this page · raw message
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c +31 -29
174 lines not on this page · raw message
drivers/net/ethernet/stmicro/stmmac/enh_desc.c +28 -27
164 lines not on this page · raw message
drivers/net/ethernet/stmicro/stmmac/norm_desc.c +25 -23
155 lines not on this page · raw message
drivers/net/ethernet/stmicro/stmmac/ring_mode.c +21 -18
@@ -34,7 +34,7 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum)unsigned int entry = priv->cur_tx;struct dma_desc *desc;unsigned int nopaged_len =skb_headlen (skb); -unsigned int bmax, len; +unsigned int bmax, len, des2;if (priv->extend_desc) desc = (struct dma_desc *)(priv->dma_etx + entry);
@@ -50,16 +50,17 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum)if (nopaged_len > BUF_SIZE_8KiB) { - desc->des2 =dma_map_single (priv->device, skb->data, - bmax,DMA_TO_DEVICE ); -if (dma_mapping_error (priv->device, desc->des2)) + des2 =dma_map_single (priv->device, skb->data, bmax, +DMA_TO_DEVICE ); + desc->des2 =cpu_to_le32 (des2); +if (dma_mapping_error (priv->device, des2))return -1 ; - priv->tx_skbuff_dma[entry].buf = desc->des2; + priv->tx_skbuff_dma[entry].buf = des2; priv->tx_skbuff_dma[entry].len = bmax; priv->tx_skbuff_dma[entry].is_jumbo = true; - desc->des3 = desc->des2 + BUF_SIZE_4KiB; + desc->des3 =cpu_to_le32 (des2 + BUF_SIZE_4KiB); priv->hw->desc->prepare_tx_desc (desc,1 , bmax, csum,STMMAC_RING_MODE ,0 , false); priv->tx_skbuff[entry] =NULL ;
@@ -70,26 +71,28 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum)else desc = priv->dma_tx + entry; - desc->des2 =dma_map_single (priv->device, skb->data + bmax, - len,DMA_TO_DEVICE ); -if (dma_mapping_error (priv->device, desc->des2)) + des2 =dma_map_single (priv->device, skb->data + bmax, len, +DMA_TO_DEVICE ); + desc->des2 =cpu_to_le32 (des2); +if (dma_mapping_error (priv->device, des2))return -1 ; - priv->tx_skbuff_dma[entry].buf = desc->des2; + priv->tx_skbuff_dma[entry].buf = des2; priv->tx_skbuff_dma[entry].len = len; priv->tx_skbuff_dma[entry].is_jumbo = true; - desc->des3 = desc->des2 + BUF_SIZE_4KiB; + desc->des3 =cpu_to_le32 (des2 + BUF_SIZE_4KiB); priv->hw->desc->prepare_tx_desc (desc,0 , len, csum,STMMAC_RING_MODE ,1 , true); }else { - desc->des2 =dma_map_single (priv->device, skb->data, - nopaged_len,DMA_TO_DEVICE ); -if (dma_mapping_error (priv->device, desc->des2)) + des2 =dma_map_single (priv->device, skb->data, + nopaged_len,DMA_TO_DEVICE ); + desc->des2 =cpu_to_le32 (des2); +if (dma_mapping_error (priv->device, des2))return -1 ; - priv->tx_skbuff_dma[entry].buf = desc->des2; + priv->tx_skbuff_dma[entry].buf = des2; priv->tx_skbuff_dma[entry].len = nopaged_len; priv->tx_skbuff_dma[entry].is_jumbo = true; - desc->des3 = desc->des2 + BUF_SIZE_4KiB; + desc->des3 =cpu_to_le32 (des2 + BUF_SIZE_4KiB); priv->hw->desc->prepare_tx_desc (desc,1 , nopaged_len, csum,STMMAC_RING_MODE ,0 , true); }
@@ -115,13 +118,13 @@ static void stmmac_refill_desc3(void *priv_ptr, struct dma_desc *p)/* Fill DES3 in case of RING mode */ if (priv->dma_buf_sz >= BUF_SIZE_8KiB) - p->des3 = p->des2 + BUF_SIZE_8KiB; + p->des3 =cpu_to_le32 (le32_to_cpu (p->des2) + BUF_SIZE_8KiB); }/* In ring mode we need to fill the desc3 because it is used as buffer */ static void stmmac_init_desc3 (struct dma_desc *p) { - p->des3 = p->des2 + BUF_SIZE_8KiB; + p->des3 =cpu_to_le32 (le32_to_cpu (p->des2) + BUF_SIZE_8KiB); }static void stmmac_clean_desc3 (void *priv_ptr,struct dma_desc *p)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +25 -26
111 lines not on this page · raw message
Signature · 1 line
2.9.2
PATCH v3 3/5 net: ethernet: sun4i-emac: Allow to enable netif messages
In reply to Michael Weisersun4i-emac has the ability to print a number of diagnostic messages using dev_dbg depending on message level settings implemented using netif_msg_* macros. But there's no way to actually enable them.
Add the ability to switch diagnostic messages on using either a module parameter debug or ethtool -s <netif> msglvl <flags>.
--- drivers/net/ethernet/allwinner/sun4i-emac.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/net/ethernet/allwinner/sun4i-emac.c +22 -0
@@ -37,6 +37,11 @@#define EMAC_MAX_FRAME_LEN 0x0600 +#define EMAC_DEFAULT_MSG_ENABLE 0x0000 +static int debug =-1 ;/* defaults above */ ; +module_param (debug, int,0 ); +MODULE_PARM_DESC (debug,"debug message flags" ); +/* Transmit timeout, default 5 seconds. */ static int watchdog =5000 ;module_param (watchdog, int,0400 );
@@ -225,11 +230,27 @@ static void emac_get_drvinfo(struct net_device *dev,strlcpy (info->bus_info,dev_name (&dev->dev),sizeof (info->bus_info)); } +static u32 emac_get_msglevel (struct net_device *dev) +{ +struct emac_board_info *db =netdev_priv (dev); + +return db->msg_enable; +} + +static void emac_set_msglevel (struct net_device *dev,u32 value) +{ +struct emac_board_info *db =netdev_priv (dev); + + db->msg_enable = value; +} +static const struct ethtool_ops emac_ethtool_ops = { .get_drvinfo = emac_get_drvinfo, .get_link = ethtool_op_get_link, .get_link_ksettings = phy_ethtool_get_link_ksettings, .set_link_ksettings = phy_ethtool_set_link_ksettings, + .get_msglevel = emac_get_msglevel, + .set_msglevel = emac_set_msglevel, };static unsigned int emac_setup (struct net_device *ndev)
@@ -805,6 +826,7 @@ static int emac_probe(struct platform_device *pdev) db->dev = &pdev->dev; db->ndev = ndev; db->pdev = pdev; + db->msg_enable =netif_msg_init (debug,EMAC_DEFAULT_MSG_ENABLE );spin_lock_init (&db->lock);
Signature · 1 line
2.9.2
PATCH v3 4/5 net: ethernet: sun4i-emac: Read rxhdr in CPU byte-order
In reply to Michael WeiserThe EMAC EMAC_RX_IO_DATA_REG data register is dual-purpose: On one hand it is used to move actual packet data off the wire. This will be in wire-format and accepted as such by higher layers such as IP. Therefore it is correctly read as-is (i.e. raw) using readsl.
On the other hand it provides metadata about incoming transfers to the driver such as length and checksum validation status. This data is little-endian, always and it is interpreted by the driver. Therefore it needs to be swapped to CPU endianness to make sense to the driver. This is already done for the "receive header" but not rxhdr.
Read rxhdr using readl in order for sun4i-emac to work correctly when running a big-endian kernel.
--- drivers/net/ethernet/allwinner/sun4i-emac.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/allwinner/sun4i-emac.c +1 -2
@@ -592,8 +592,7 @@ static void emac_rx(struct net_device *dev)/* A packet ready now & Get status/length */ good_packet = true; -emac_inblk_32bit (db->membase +EMAC_RX_IO_DATA_REG , - &rxhdr,sizeof (rxhdr)); + rxhdr =readl (db->membase +EMAC_RX_IO_DATA_REG );if (netif_msg_rx_status (db))dev_dbg (db->dev,"rxhdr: %x\n" , *((int *)(&rxhdr)));
Signature · 1 line
2.9.2
PATCH v3 5/5 ARM: sunxi: enable big-endian
In reply to Michael WeiserWith previous fixes to stmmac, sun4i-emac and sun4i-mmc at least the Cubieboard2 incarnation of sunxi works correctly in big-endian mode. Allow the selection of big-endian.
Tested using a Cubieboard Two-Card and the following hardware-components:
- GMAC (stmmac)
- EMAC (sun4i-emac)
- SATA
- SPI
- UART
- security system
- touchscreen controller hwmon functionality
- pinctrl (custom interrupt for SPI ethernet controller)
- watchdog as reset controller
- onboard RTC
- DS1307 I2C RTC
- sound codec and with this indirectly the DMA engine
--- arch/arm/mach-sunxi/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-sunxi/Kconfig +1 -0
@@ -1,6 +1,7 @@ menuconfig ARCH_SUNXI bool "Allwinner SoCs" depends on ARCH_MULTI_V7 + select ARCH_SUPPORTS_BIG_ENDIAN select ARCH_HAS_RESET_CONTROLLER select CLKSRC_MMIO select GENERIC_IRQ_CHIP
Signature · 1 line
2.9.2
PATCH 5/5 ARM: sunxi: enable big-endian
Hi Michael,
Quoted 4 lines · Michael Weiser
With previous fixes to stmmac, sun4i-emac and sun4i-mmc at least the Cubieboard2 incarnation of sunxi works correctly in big-endian mode. Allow the selection of big-endian.
Quoted 14 lines
Tested using a Cubieboard Two-Card and the following hardware-components:
- GMAC (stmmac)
- EMAC (sun4i-emac)
- SATA
- SPI
- UART
- security system
- touchscreen controller hwmon functionality
- pinctrl (custom interrupt for SPI ethernet controller)
- watchdog as reset controller
- onboard RTC
- DS1307 I2C RTC
- sound codec and with this indirectly the DMA engine
Thanks for all the testing, it's really appreciated :)
Quoted 13 lines
Signed-off-by Michael Weiser <[email protected]>Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Cc linux-arm-kernel at lists.infradead.org--- arch/arm/mach-sunxi/Kconfig | 1 + 1 file changed, 1 insertion(+)arch/arm/mach-sunxi/Kconfig +0
-0
arch/arm/mach-sunxi/Kconfig line 4
Quoted 4 lines
arch/arm/mach-sunxi/Kconfig +1
-0@@ -1,6 +1,7 @@ menuconfig ARCH_SUNXI bool "Allwinner SoCs" depends on ARCH_MULTI_V7 + select ARCH_SUPPORTS_BIG_ENDIAN
However, you only tested it on the A20. I'd like to be conservative on this one and only enable it on tested platforms. In this case, that would mean to only select it for MACH_SUN7I.
Thanks!
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160822/38134afd/attachment.sig>