Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e84b496 authored by David S. Miller's avatar David S. Miller
Browse files
parents 5c91ae08 9d01412a
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -56,6 +56,13 @@ ip_forward_use_pmtu - BOOLEAN
	0 - disabled
	1 - enabled

fwmark_reflect - BOOLEAN
	Controls the fwmark of kernel-generated IPv4 reply packets that are not
	associated with a socket for example, TCP RSTs or ICMP echo replies).
	If unset, these packets have a fwmark of zero. If set, they have the
	fwmark of the packet they are replying to.
	Default: 0

route/max_size - INTEGER
	Maximum number of routes allowed in the kernel.  Increase
	this when using large numbers of interfaces and/or routes.
@@ -1209,6 +1216,13 @@ conf/all/forwarding - BOOLEAN
proxy_ndp - BOOLEAN
	Do proxy ndp.

fwmark_reflect - BOOLEAN
	Controls the fwmark of kernel-generated IPv6 reply packets that are not
	associated with a socket for example, TCP RSTs or ICMPv6 echo replies).
	If unset, these packets have a fwmark of zero. If set, they have the
	fwmark of the packet they are replying to.
	Default: 0

conf/interface/*:
	Change special settings per interface.

+5 −5
Original line number Diff line number Diff line
@@ -599,7 +599,7 @@
			compatible = "apm,xgene-enet";
			status = "disabled";
			reg = <0x0 0x17020000 0x0 0xd100>,
			      <0x0 0X17030000 0x0 0X400>,
			      <0x0 0X17030000 0x0 0Xc300>,
			      <0x0 0X10000000 0x0 0X200>;
			reg-names = "enet_csr", "ring_csr", "ring_cmd";
			interrupts = <0x0 0x3c 0x4>;
@@ -624,9 +624,9 @@
		sgenet0: ethernet@1f210000 {
			compatible = "apm,xgene-enet";
			status = "disabled";
			reg = <0x0 0x1f210000 0x0 0x10000>,
			      <0x0 0x1f200000 0x0 0X10000>,
			      <0x0 0x1B000000 0x0 0X20000>;
			reg = <0x0 0x1f210000 0x0 0xd100>,
			      <0x0 0x1f200000 0x0 0Xc300>,
			      <0x0 0x1B000000 0x0 0X200>;
			reg-names = "enet_csr", "ring_csr", "ring_cmd";
			interrupts = <0x0 0xA0 0x4>;
			dma-coherent;
@@ -639,7 +639,7 @@
			compatible = "apm,xgene-enet";
			status = "disabled";
			reg = <0x0 0x1f610000 0x0 0xd100>,
			      <0x0 0x1f600000 0x0 0X400>,
			      <0x0 0x1f600000 0x0 0Xc300>,
			      <0x0 0x18000000 0x0 0X200>;
			reg-names = "enet_csr", "ring_csr", "ring_cmd";
			interrupts = <0x0 0x60 0x4>;
+17 −1
Original line number Diff line number Diff line
@@ -575,10 +575,24 @@ static void xgene_gmac_tx_disable(struct xgene_enet_pdata *pdata)
	xgene_enet_wr_mcx_mac(pdata, MAC_CONFIG_1_ADDR, data & ~TX_EN);
}

static void xgene_enet_reset(struct xgene_enet_pdata *pdata)
bool xgene_ring_mgr_init(struct xgene_enet_pdata *p)
{
	if (!ioread32(p->ring_csr_addr + CLKEN_ADDR))
		return false;

	if (ioread32(p->ring_csr_addr + SRST_ADDR))
		return false;

	return true;
}

static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
{
	u32 val;

	if (!xgene_ring_mgr_init(pdata))
		return -ENODEV;

	clk_prepare_enable(pdata->clk);
	clk_disable_unprepare(pdata->clk);
	clk_prepare_enable(pdata->clk);
@@ -590,6 +604,8 @@ static void xgene_enet_reset(struct xgene_enet_pdata *pdata)
	val |= SCAN_AUTO_INCR;
	MGMT_CLOCK_SEL_SET(&val, 1);
	xgene_enet_wr_mcx_mac(pdata, MII_MGMT_CONFIG_ADDR, val);

	return 0;
}

static void xgene_gport_shutdown(struct xgene_enet_pdata *pdata)
+4 −0
Original line number Diff line number Diff line
@@ -104,6 +104,9 @@ enum xgene_enet_rm {
#define BLOCK_ETH_MAC_OFFSET		0x0000
#define BLOCK_ETH_MAC_CSR_OFFSET	0x2800

#define CLKEN_ADDR			0xc208
#define SRST_ADDR			0xc200

#define MAC_ADDR_REG_OFFSET		0x00
#define MAC_COMMAND_REG_OFFSET		0x04
#define MAC_WRITE_REG_OFFSET		0x08
@@ -318,6 +321,7 @@ void xgene_enet_parse_error(struct xgene_enet_desc_ring *ring,

int xgene_enet_mdio_config(struct xgene_enet_pdata *pdata);
void xgene_enet_mdio_remove(struct xgene_enet_pdata *pdata);
bool xgene_ring_mgr_init(struct xgene_enet_pdata *p);

extern struct xgene_mac_ops xgene_gmac_ops;
extern struct xgene_port_ops xgene_gport_ops;
+7 −4
Original line number Diff line number Diff line
@@ -639,9 +639,9 @@ static int xgene_enet_create_desc_rings(struct net_device *ndev)
	struct device *dev = ndev_to_dev(ndev);
	struct xgene_enet_desc_ring *rx_ring, *tx_ring, *cp_ring;
	struct xgene_enet_desc_ring *buf_pool = NULL;
	u8 cpu_bufnum = 0, eth_bufnum = 0;
	u8 bp_bufnum = 0x20;
	u16 ring_id, ring_num = 0;
	u8 cpu_bufnum = 0, eth_bufnum = START_ETH_BUFNUM;
	u8 bp_bufnum = START_BP_BUFNUM;
	u16 ring_id, ring_num = START_RING_NUM;
	int ret;

	/* allocate rx descriptor ring */
@@ -840,7 +840,9 @@ static int xgene_enet_init_hw(struct xgene_enet_pdata *pdata)
	u16 dst_ring_num;
	int ret;

	pdata->port_ops->reset(pdata);
	ret = pdata->port_ops->reset(pdata);
	if (ret)
		return ret;

	ret = xgene_enet_create_desc_rings(ndev);
	if (ret) {
@@ -942,6 +944,7 @@ static int xgene_enet_probe(struct platform_device *pdev)

	return ret;
err:
	unregister_netdev(ndev);
	free_netdev(ndev);
	return ret;
}
Loading