#include <linux/platform_device.h>
#include <linux/serial_8250.h>
#include <linux/clk.h>
+#include <linux/sizes.h>
#include <asm/mach-ath79/ath79.h>
#include <asm/mach-ath79/ar71xx_regs.h>
mdio_data->is_ar934x = 1;
break;
- case ATH79_SOC_QCA9558:
- if (id == 1)
- mdio_data->builtin_switch = 1;
- mdio_data->is_ar934x = 1;
- break;
-
case ATH79_SOC_QCA9556:
+ case ATH79_SOC_QCA9558:
mdio_data->is_ar934x = 1;
break;
pdata->has_gbit = 1;
pdata->is_ar724x = 1;
+ pdata->max_frame_len = SZ_16K - 1;
+ pdata->desc_pktlen_mask = SZ_16K - 1;
+
if (!pdata->fifo_cfg1)
pdata->fifo_cfg1 = 0x0010ffff;
if (!pdata->fifo_cfg2)
pdata->has_gbit = 1;
pdata->is_ar724x = 1;
+ /*
+ * Limit the maximum frame length to 4095 bytes.
+ * Although the documentation says that the hardware
+ * limit is 16383 bytes but that does not work in
+ * practice. It seems that the hardware only updates
+ * the lowest 12 bits of the packet length field
+ * in the RX descriptor.
+ */
+ pdata->max_frame_len = SZ_4K - 1;
+ pdata->desc_pktlen_mask = SZ_16K - 1;
+
if (!pdata->fifo_cfg1)
pdata->fifo_cfg1 = 0x0010ffff;
if (!pdata->fifo_cfg2)