ixp4xx_eth: move platform_data definition
authorArnd Bergmann <arnd@arndb.de>
Sun, 12 Jan 2020 12:04:45 +0000 (13:04 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sun, 12 Jan 2020 20:59:53 +0000 (12:59 -0800)
The platform data is needed to compile the driver as standalone,
so move it to a global location along with similar files.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
arch/arm/mach-ixp4xx/include/mach/platform.h
drivers/net/ethernet/xscale/ixp46x_ts.h [new file with mode: 0644]
drivers/net/ethernet/xscale/ixp4xx_eth.c
drivers/net/ethernet/xscale/ptp_ixp46x.h [deleted file]
include/linux/platform_data/eth_ixp4xx.h [new file with mode: 0644]

index 04ef802..6d403fe 100644 (file)
@@ -15,6 +15,7 @@
 #ifndef __ASSEMBLY__
 
 #include <linux/reboot.h>
+#include <linux/platform_data/eth_ixp4xx.h>
 
 #include <asm/types.h>
 
@@ -92,18 +93,6 @@ struct ixp4xx_pata_data {
        void __iomem    *cs1;
 };
 
-#define IXP4XX_ETH_NPEA                0x00
-#define IXP4XX_ETH_NPEB                0x10
-#define IXP4XX_ETH_NPEC                0x20
-
-/* Information about built-in Ethernet MAC interfaces */
-struct eth_plat_info {
-       u8 phy;         /* MII PHY ID, 0 - 31 */
-       u8 rxq;         /* configurable, currently 0 - 31 only */
-       u8 txreadyq;
-       u8 hwaddr[6];
-};
-
 /*
  * Frequency of clock used for primary clocksource
  */
diff --git a/drivers/net/ethernet/xscale/ixp46x_ts.h b/drivers/net/ethernet/xscale/ixp46x_ts.h
new file mode 100644 (file)
index 0000000..d792130
--- /dev/null
@@ -0,0 +1,68 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * PTP 1588 clock using the IXP46X
+ *
+ * Copyright (C) 2010 OMICRON electronics GmbH
+ */
+
+#ifndef _IXP46X_TS_H_
+#define _IXP46X_TS_H_
+
+#define DEFAULT_ADDEND 0xF0000029
+#define TICKS_NS_SHIFT 4
+
+struct ixp46x_channel_ctl {
+       u32 ch_control;  /* 0x40 Time Synchronization Channel Control */
+       u32 ch_event;    /* 0x44 Time Synchronization Channel Event */
+       u32 tx_snap_lo;  /* 0x48 Transmit Snapshot Low Register */
+       u32 tx_snap_hi;  /* 0x4C Transmit Snapshot High Register */
+       u32 rx_snap_lo;  /* 0x50 Receive Snapshot Low Register */
+       u32 rx_snap_hi;  /* 0x54 Receive Snapshot High Register */
+       u32 src_uuid_lo; /* 0x58 Source UUID0 Low Register */
+       u32 src_uuid_hi; /* 0x5C Sequence Identifier/Source UUID0 High */
+};
+
+struct ixp46x_ts_regs {
+       u32 control;     /* 0x00 Time Sync Control Register */
+       u32 event;       /* 0x04 Time Sync Event Register */
+       u32 addend;      /* 0x08 Time Sync Addend Register */
+       u32 accum;       /* 0x0C Time Sync Accumulator Register */
+       u32 test;        /* 0x10 Time Sync Test Register */
+       u32 unused;      /* 0x14 */
+       u32 rsystime_lo; /* 0x18 RawSystemTime_Low Register */
+       u32 rsystime_hi; /* 0x1C RawSystemTime_High Register */
+       u32 systime_lo;  /* 0x20 SystemTime_Low Register */
+       u32 systime_hi;  /* 0x24 SystemTime_High Register */
+       u32 trgt_lo;     /* 0x28 TargetTime_Low Register */
+       u32 trgt_hi;     /* 0x2C TargetTime_High Register */
+       u32 asms_lo;     /* 0x30 Auxiliary Slave Mode Snapshot Low  */
+       u32 asms_hi;     /* 0x34 Auxiliary Slave Mode Snapshot High */
+       u32 amms_lo;     /* 0x38 Auxiliary Master Mode Snapshot Low */
+       u32 amms_hi;     /* 0x3C Auxiliary Master Mode Snapshot High */
+
+       struct ixp46x_channel_ctl channel[3];
+};
+
+/* 0x00 Time Sync Control Register Bits */
+#define TSCR_AMM (1<<3)
+#define TSCR_ASM (1<<2)
+#define TSCR_TTM (1<<1)
+#define TSCR_RST (1<<0)
+
+/* 0x04 Time Sync Event Register Bits */
+#define TSER_SNM (1<<3)
+#define TSER_SNS (1<<2)
+#define TTIPEND  (1<<1)
+
+/* 0x40 Time Synchronization Channel Control Register Bits */
+#define MASTER_MODE   (1<<0)
+#define TIMESTAMP_ALL (1<<1)
+
+/* 0x44 Time Synchronization Channel Event Register Bits */
+#define TX_SNAPSHOT_LOCKED (1<<0)
+#define RX_SNAPSHOT_LOCKED (1<<1)
+
+/* The ptp_ixp46x module will set this variable */
+extern int ixp46x_phc_index;
+
+#endif
index 0075ecd..e811bf0 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/net_tstamp.h>
 #include <linux/of.h>
 #include <linux/phy.h>
+#include <linux/platform_data/eth_ixp4xx.h>
 #include <linux/platform_device.h>
 #include <linux/ptp_classify.h>
 #include <linux/slab.h>
diff --git a/drivers/net/ethernet/xscale/ptp_ixp46x.h b/drivers/net/ethernet/xscale/ptp_ixp46x.h
deleted file mode 100644 (file)
index d792130..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * PTP 1588 clock using the IXP46X
- *
- * Copyright (C) 2010 OMICRON electronics GmbH
- */
-
-#ifndef _IXP46X_TS_H_
-#define _IXP46X_TS_H_
-
-#define DEFAULT_ADDEND 0xF0000029
-#define TICKS_NS_SHIFT 4
-
-struct ixp46x_channel_ctl {
-       u32 ch_control;  /* 0x40 Time Synchronization Channel Control */
-       u32 ch_event;    /* 0x44 Time Synchronization Channel Event */
-       u32 tx_snap_lo;  /* 0x48 Transmit Snapshot Low Register */
-       u32 tx_snap_hi;  /* 0x4C Transmit Snapshot High Register */
-       u32 rx_snap_lo;  /* 0x50 Receive Snapshot Low Register */
-       u32 rx_snap_hi;  /* 0x54 Receive Snapshot High Register */
-       u32 src_uuid_lo; /* 0x58 Source UUID0 Low Register */
-       u32 src_uuid_hi; /* 0x5C Sequence Identifier/Source UUID0 High */
-};
-
-struct ixp46x_ts_regs {
-       u32 control;     /* 0x00 Time Sync Control Register */
-       u32 event;       /* 0x04 Time Sync Event Register */
-       u32 addend;      /* 0x08 Time Sync Addend Register */
-       u32 accum;       /* 0x0C Time Sync Accumulator Register */
-       u32 test;        /* 0x10 Time Sync Test Register */
-       u32 unused;      /* 0x14 */
-       u32 rsystime_lo; /* 0x18 RawSystemTime_Low Register */
-       u32 rsystime_hi; /* 0x1C RawSystemTime_High Register */
-       u32 systime_lo;  /* 0x20 SystemTime_Low Register */
-       u32 systime_hi;  /* 0x24 SystemTime_High Register */
-       u32 trgt_lo;     /* 0x28 TargetTime_Low Register */
-       u32 trgt_hi;     /* 0x2C TargetTime_High Register */
-       u32 asms_lo;     /* 0x30 Auxiliary Slave Mode Snapshot Low  */
-       u32 asms_hi;     /* 0x34 Auxiliary Slave Mode Snapshot High */
-       u32 amms_lo;     /* 0x38 Auxiliary Master Mode Snapshot Low */
-       u32 amms_hi;     /* 0x3C Auxiliary Master Mode Snapshot High */
-
-       struct ixp46x_channel_ctl channel[3];
-};
-
-/* 0x00 Time Sync Control Register Bits */
-#define TSCR_AMM (1<<3)
-#define TSCR_ASM (1<<2)
-#define TSCR_TTM (1<<1)
-#define TSCR_RST (1<<0)
-
-/* 0x04 Time Sync Event Register Bits */
-#define TSER_SNM (1<<3)
-#define TSER_SNS (1<<2)
-#define TTIPEND  (1<<1)
-
-/* 0x40 Time Synchronization Channel Control Register Bits */
-#define MASTER_MODE   (1<<0)
-#define TIMESTAMP_ALL (1<<1)
-
-/* 0x44 Time Synchronization Channel Event Register Bits */
-#define TX_SNAPSHOT_LOCKED (1<<0)
-#define RX_SNAPSHOT_LOCKED (1<<1)
-
-/* The ptp_ixp46x module will set this variable */
-extern int ixp46x_phc_index;
-
-#endif
diff --git a/include/linux/platform_data/eth_ixp4xx.h b/include/linux/platform_data/eth_ixp4xx.h
new file mode 100644 (file)
index 0000000..6f652ea
--- /dev/null
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __PLATFORM_DATA_ETH_IXP4XX
+#define __PLATFORM_DATA_ETH_IXP4XX
+
+#include <linux/types.h>
+
+#define IXP4XX_ETH_NPEA                0x00
+#define IXP4XX_ETH_NPEB                0x10
+#define IXP4XX_ETH_NPEC                0x20
+
+/* Information about built-in Ethernet MAC interfaces */
+struct eth_plat_info {
+       u8 phy;         /* MII PHY ID, 0 - 31 */
+       u8 rxq;         /* configurable, currently 0 - 31 only */
+       u8 txreadyq;
+       u8 hwaddr[6];
+};
+
+#endif