[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221017215947.7438-4-vfedorenko@novek.ru>
Date: Tue, 18 Oct 2022 00:59:45 +0300
From: Vadim Fedorenko <vfedorenko@...ek.ru>
To: Richard Cochran <richardcochran@...il.com>,
Jonathan Lemon <jonathan.lemon@...il.com>,
Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, Vadim Fedorenko <vadfed@...com>,
Charles Parent <charles.parent@...lia2s.com>
Subject: [PATCH net-next 3/5] ptp: ocp: add serial port of mRO50 MAC on ART card
From: Vadim Fedorenko <vadfed@...com>
ART card provides interface to access to serial port of miniature atomic
clock found on the card. Add support for this device and configure it
during init phase.
Co-developed-by: Charles Parent <charles.parent@...lia2s.com>
Signed-off-by: Vadim Fedorenko <vadfed@...com>
---
drivers/ptp/ptp_ocp.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index cd4f3860d72a..d8a723e9e21c 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -213,6 +213,11 @@ struct frequency_reg {
u32 ctrl;
u32 status;
};
+
+struct board_config_reg {
+ u32 mro50_serial_activate;
+};
+
#define FREQ_STATUS_VALID BIT(31)
#define FREQ_STATUS_ERROR BIT(30)
#define FREQ_STATUS_OVERRUN BIT(29)
@@ -304,6 +309,7 @@ struct ptp_ocp {
struct tod_reg __iomem *tod;
struct pps_reg __iomem *pps_to_ext;
struct pps_reg __iomem *pps_to_clk;
+ struct board_config_reg __iomem *board_config;
struct gpio_reg __iomem *pps_select;
struct gpio_reg __iomem *sma_map1;
struct gpio_reg __iomem *sma_map2;
@@ -801,6 +807,17 @@ static struct ocp_resource ocp_art_resource[] = {
},
},
},
+ {
+ OCP_SERIAL_RESOURCE(mac_port),
+ .offset = 0x00190000, .irq_vec = 7,
+ .extra = &(struct ptp_ocp_serial_port) {
+ .baud = 9600,
+ },
+ },
+ {
+ OCP_MEM_RESOURCE(board_config),
+ .offset = 0x210000, .size = 0x1000,
+ },
{
.setup = ptp_ocp_art_board_init,
},
@@ -2416,6 +2433,9 @@ ptp_ocp_art_board_init(struct ptp_ocp *bp, struct ocp_resource *r)
bp->fw_tag = 2;
bp->sma_op = &ocp_art_sma_op;
+ /* Enable MAC serial port during initialisation */
+ iowrite32(1, &bp->board_config->mro50_serial_activate);
+
ptp_ocp_sma_init(bp);
err = ptp_ocp_attr_group_add(bp, art_timecard_groups);
--
2.27.0
Powered by blists - more mailing lists