blob: 92a055561ebde4bd4bd5cb67b8343357bb4f777b [file] [log] [blame]
Gregory CLEMENTdd1033e2018-12-14 16:16:47 +01001/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
2/*
3 * Copyright (c) 2018 Microsemi Corporation
4 */
5
6#ifndef __ASM_MACH_COMMON_H
7#define __ASM_MACH_COMMON_H
8
9#if defined(CONFIG_SOC_OCELOT)
10#include <mach/ocelot/ocelot.h>
11#include <mach/ocelot/ocelot_devcpu_gcb.h>
Lars Povlsen3098ade2018-12-20 09:56:02 +010012#include <mach/ocelot/ocelot_devcpu_gcb_miim_regs.h>
Gregory CLEMENTdd1033e2018-12-14 16:16:47 +010013#include <mach/ocelot/ocelot_icpu_cfg.h>
Gregory CLEMENT6bd82312018-12-14 16:16:48 +010014#elif defined(CONFIG_SOC_LUTON)
15#include <mach/luton/luton.h>
16#include <mach/luton/luton_devcpu_gcb.h>
Lars Povlsen3098ade2018-12-20 09:56:02 +010017#include <mach/luton/luton_devcpu_gcb_miim_regs.h>
Gregory CLEMENT6bd82312018-12-14 16:16:48 +010018#include <mach/luton/luton_icpu_cfg.h>
Gregory CLEMENTdd1033e2018-12-14 16:16:47 +010019#else
20#error Unsupported platform
21#endif
22
23#define MSCC_DDR_TO 0x20000000 /* DDR RAM base offset */
24#define MSCC_MEMCTL1_TO 0x40000000 /* SPI/PI base offset */
25#define MSCC_MEMCTL2_TO 0x50000000 /* SPI/PI base offset */
26#define MSCC_FLASH_TO MSCC_MEMCTL1_TO /* Flash base offset */
27
28#define VCOREIII_TIMER_DIVIDER 25 /* Clock tick ~ 0.1 us */
29
Lars Povlsen3098ade2018-12-20 09:56:02 +010030/* Common utility functions */
31
32int mscc_phy_rd_wr(u8 read,
33 u32 miim_controller,
34 u8 miim_addr,
35 u8 addr,
36 u16 *value);
37
38int mscc_phy_rd(u32 miim_controller,
39 u8 miim_addr,
40 u8 addr,
41 u16 *value);
42
43int mscc_phy_wr(u32 miim_controller,
44 u8 miim_addr,
45 u8 addr,
46 u16 value);
47
Gregory CLEMENTdd1033e2018-12-14 16:16:47 +010048#endif /* __ASM_MACH_COMMON_H */