18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/* Hardware definitions for SSI.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Copyright (C) 2010 Nokia Corporation. All rights reserved.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Contact: Carlos Chinea <carlos.chinea@nokia.com>
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef __OMAP_SSI_REGS_H__
108c2ecf20Sopenharmony_ci#define __OMAP_SSI_REGS_H__
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci/*
138c2ecf20Sopenharmony_ci * SSI SYS registers
148c2ecf20Sopenharmony_ci */
158c2ecf20Sopenharmony_ci#define SSI_REVISION_REG    0
168c2ecf20Sopenharmony_ci#  define SSI_REV_MAJOR    0xf0
178c2ecf20Sopenharmony_ci#  define SSI_REV_MINOR    0xf
188c2ecf20Sopenharmony_ci#define SSI_SYSCONFIG_REG    0x10
198c2ecf20Sopenharmony_ci#  define SSI_AUTOIDLE    (1 << 0)
208c2ecf20Sopenharmony_ci#  define SSI_SOFTRESET    (1 << 1)
218c2ecf20Sopenharmony_ci#  define SSI_SIDLEMODE_FORCE  0
228c2ecf20Sopenharmony_ci#  define SSI_SIDLEMODE_NO    (1 << 3)
238c2ecf20Sopenharmony_ci#  define SSI_SIDLEMODE_SMART  (1 << 4)
248c2ecf20Sopenharmony_ci#  define SSI_SIDLEMODE_MASK  0x18
258c2ecf20Sopenharmony_ci#  define SSI_MIDLEMODE_FORCE  0
268c2ecf20Sopenharmony_ci#  define SSI_MIDLEMODE_NO    (1 << 12)
278c2ecf20Sopenharmony_ci#  define SSI_MIDLEMODE_SMART  (1 << 13)
288c2ecf20Sopenharmony_ci#  define SSI_MIDLEMODE_MASK  0x3000
298c2ecf20Sopenharmony_ci#define SSI_SYSSTATUS_REG    0x14
308c2ecf20Sopenharmony_ci#  define SSI_RESETDONE    1
318c2ecf20Sopenharmony_ci#define SSI_MPU_STATUS_REG(port, irq)  (0x808 + ((port) * 0x10) + ((irq) * 2))
328c2ecf20Sopenharmony_ci#define SSI_MPU_ENABLE_REG(port, irq)  (0x80c + ((port) * 0x10) + ((irq) * 8))
338c2ecf20Sopenharmony_ci#  define SSI_DATAACCEPT(channel)    (1 << (channel))
348c2ecf20Sopenharmony_ci#  define SSI_DATAAVAILABLE(channel)  (1 << ((channel) + 8))
358c2ecf20Sopenharmony_ci#  define SSI_DATAOVERRUN(channel)    (1 << ((channel) + 16))
368c2ecf20Sopenharmony_ci#  define SSI_ERROROCCURED      (1 << 24)
378c2ecf20Sopenharmony_ci#  define SSI_BREAKDETECTED    (1 << 25)
388c2ecf20Sopenharmony_ci#define SSI_GDD_MPU_IRQ_STATUS_REG  0x0800
398c2ecf20Sopenharmony_ci#define SSI_GDD_MPU_IRQ_ENABLE_REG  0x0804
408c2ecf20Sopenharmony_ci#  define SSI_GDD_LCH(channel)  (1 << (channel))
418c2ecf20Sopenharmony_ci#define SSI_WAKE_REG(port)    (0xc00 + ((port) * 0x10))
428c2ecf20Sopenharmony_ci#define SSI_CLEAR_WAKE_REG(port)  (0xc04 + ((port) * 0x10))
438c2ecf20Sopenharmony_ci#define SSI_SET_WAKE_REG(port)    (0xc08 + ((port) * 0x10))
448c2ecf20Sopenharmony_ci#  define SSI_WAKE(channel)  (1 << (channel))
458c2ecf20Sopenharmony_ci#  define SSI_WAKE_MASK    0xff
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci/*
488c2ecf20Sopenharmony_ci * SSI SST registers
498c2ecf20Sopenharmony_ci */
508c2ecf20Sopenharmony_ci#define SSI_SST_ID_REG      0
518c2ecf20Sopenharmony_ci#define SSI_SST_MODE_REG    4
528c2ecf20Sopenharmony_ci#  define SSI_MODE_VAL_MASK  3
538c2ecf20Sopenharmony_ci#  define SSI_MODE_SLEEP    0
548c2ecf20Sopenharmony_ci#  define SSI_MODE_STREAM    1
558c2ecf20Sopenharmony_ci#  define SSI_MODE_FRAME    2
568c2ecf20Sopenharmony_ci#  define SSI_MODE_MULTIPOINTS  3
578c2ecf20Sopenharmony_ci#define SSI_SST_FRAMESIZE_REG    8
588c2ecf20Sopenharmony_ci#  define SSI_FRAMESIZE_DEFAULT  31
598c2ecf20Sopenharmony_ci#define SSI_SST_TXSTATE_REG    0xc
608c2ecf20Sopenharmony_ci#  define  SSI_TXSTATE_IDLE  0
618c2ecf20Sopenharmony_ci#define SSI_SST_BUFSTATE_REG    0x10
628c2ecf20Sopenharmony_ci#  define  SSI_FULL(channel)  (1 << (channel))
638c2ecf20Sopenharmony_ci#define SSI_SST_DIVISOR_REG    0x18
648c2ecf20Sopenharmony_ci#  define SSI_MAX_DIVISOR    127
658c2ecf20Sopenharmony_ci#define SSI_SST_BREAK_REG    0x20
668c2ecf20Sopenharmony_ci#define SSI_SST_CHANNELS_REG    0x24
678c2ecf20Sopenharmony_ci#  define SSI_CHANNELS_DEFAULT  4
688c2ecf20Sopenharmony_ci#define SSI_SST_ARBMODE_REG    0x28
698c2ecf20Sopenharmony_ci#  define SSI_ARBMODE_ROUNDROBIN  0
708c2ecf20Sopenharmony_ci#  define SSI_ARBMODE_PRIORITY  1
718c2ecf20Sopenharmony_ci#define SSI_SST_BUFFER_CH_REG(channel)  (0x80 + ((channel) * 4))
728c2ecf20Sopenharmony_ci#define SSI_SST_SWAPBUF_CH_REG(channel)  (0xc0 + ((channel) * 4))
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci/*
758c2ecf20Sopenharmony_ci * SSI SSR registers
768c2ecf20Sopenharmony_ci */
778c2ecf20Sopenharmony_ci#define SSI_SSR_ID_REG      0
788c2ecf20Sopenharmony_ci#define SSI_SSR_MODE_REG    4
798c2ecf20Sopenharmony_ci#define SSI_SSR_FRAMESIZE_REG    8
808c2ecf20Sopenharmony_ci#define SSI_SSR_RXSTATE_REG    0xc
818c2ecf20Sopenharmony_ci#define SSI_SSR_BUFSTATE_REG    0x10
828c2ecf20Sopenharmony_ci#  define SSI_NOTEMPTY(channel)  (1 << (channel))
838c2ecf20Sopenharmony_ci#define SSI_SSR_BREAK_REG    0x1c
848c2ecf20Sopenharmony_ci#define SSI_SSR_ERROR_REG    0x20
858c2ecf20Sopenharmony_ci#define SSI_SSR_ERRORACK_REG    0x24
868c2ecf20Sopenharmony_ci#define SSI_SSR_OVERRUN_REG    0x2c
878c2ecf20Sopenharmony_ci#define SSI_SSR_OVERRUNACK_REG    0x30
888c2ecf20Sopenharmony_ci#define SSI_SSR_TIMEOUT_REG    0x34
898c2ecf20Sopenharmony_ci#  define SSI_TIMEOUT_DEFAULT  0
908c2ecf20Sopenharmony_ci#define SSI_SSR_CHANNELS_REG    0x28
918c2ecf20Sopenharmony_ci#define SSI_SSR_BUFFER_CH_REG(channel)  (0x80 + ((channel) * 4))
928c2ecf20Sopenharmony_ci#define SSI_SSR_SWAPBUF_CH_REG(channel)  (0xc0 + ((channel) * 4))
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci/*
958c2ecf20Sopenharmony_ci * SSI GDD registers
968c2ecf20Sopenharmony_ci */
978c2ecf20Sopenharmony_ci#define SSI_GDD_HW_ID_REG    0
988c2ecf20Sopenharmony_ci#define SSI_GDD_PPORT_ID_REG    0x10
998c2ecf20Sopenharmony_ci#define SSI_GDD_MPORT_ID_REG    0x14
1008c2ecf20Sopenharmony_ci#define SSI_GDD_PPORT_SR_REG    0x20
1018c2ecf20Sopenharmony_ci#define SSI_GDD_MPORT_SR_REG    0x24
1028c2ecf20Sopenharmony_ci#  define SSI_ACTIVE_LCH_NUM_MASK  0xff
1038c2ecf20Sopenharmony_ci#define SSI_GDD_TEST_REG    0x40
1048c2ecf20Sopenharmony_ci#  define SSI_TEST      1
1058c2ecf20Sopenharmony_ci#define SSI_GDD_GCR_REG      0x100
1068c2ecf20Sopenharmony_ci#  define  SSI_CLK_AUTOGATING_ON  (1 << 3)
1078c2ecf20Sopenharmony_ci#  define  SSI_FREE    (1 << 2)
1088c2ecf20Sopenharmony_ci#  define  SSI_SWITCH_OFF    (1 << 0)
1098c2ecf20Sopenharmony_ci#define SSI_GDD_GRST_REG    0x200
1108c2ecf20Sopenharmony_ci#  define SSI_SWRESET    1
1118c2ecf20Sopenharmony_ci#define SSI_GDD_CSDP_REG(channel)  (0x800 + ((channel) * 0x40))
1128c2ecf20Sopenharmony_ci#  define SSI_DST_BURST_EN_MASK  0xc000
1138c2ecf20Sopenharmony_ci#  define SSI_DST_SINGLE_ACCESS0  0
1148c2ecf20Sopenharmony_ci#  define SSI_DST_SINGLE_ACCESS  (1 << 14)
1158c2ecf20Sopenharmony_ci#  define SSI_DST_BURST_4x32_BIT  (2 << 14)
1168c2ecf20Sopenharmony_ci#  define SSI_DST_BURST_8x32_BIT  (3 << 14)
1178c2ecf20Sopenharmony_ci#  define SSI_DST_MASK    0x1e00
1188c2ecf20Sopenharmony_ci#  define SSI_DST_MEMORY_PORT  (8 << 9)
1198c2ecf20Sopenharmony_ci#  define SSI_DST_PERIPHERAL_PORT  (9 << 9)
1208c2ecf20Sopenharmony_ci#  define SSI_SRC_BURST_EN_MASK  0x180
1218c2ecf20Sopenharmony_ci#  define SSI_SRC_SINGLE_ACCESS0  0
1228c2ecf20Sopenharmony_ci#  define SSI_SRC_SINGLE_ACCESS  (1 << 7)
1238c2ecf20Sopenharmony_ci#  define SSI_SRC_BURST_4x32_BIT  (2 << 7)
1248c2ecf20Sopenharmony_ci#  define SSI_SRC_BURST_8x32_BIT  (3 << 7)
1258c2ecf20Sopenharmony_ci#  define SSI_SRC_MASK    0x3c
1268c2ecf20Sopenharmony_ci#  define SSI_SRC_MEMORY_PORT  (8 << 2)
1278c2ecf20Sopenharmony_ci#  define SSI_SRC_PERIPHERAL_PORT  (9 << 2)
1288c2ecf20Sopenharmony_ci#  define SSI_DATA_TYPE_MASK  3
1298c2ecf20Sopenharmony_ci#  define SSI_DATA_TYPE_S32  2
1308c2ecf20Sopenharmony_ci#define SSI_GDD_CCR_REG(channel)  (0x802 + ((channel) * 0x40))
1318c2ecf20Sopenharmony_ci#  define SSI_DST_AMODE_MASK  (3 << 14)
1328c2ecf20Sopenharmony_ci#  define SSI_DST_AMODE_CONST  0
1338c2ecf20Sopenharmony_ci#  define SSI_DST_AMODE_POSTINC  (1 << 12)
1348c2ecf20Sopenharmony_ci#  define SSI_SRC_AMODE_MASK  (3 << 12)
1358c2ecf20Sopenharmony_ci#  define SSI_SRC_AMODE_CONST  0
1368c2ecf20Sopenharmony_ci#  define SSI_SRC_AMODE_POSTINC  (1 << 12)
1378c2ecf20Sopenharmony_ci#  define SSI_CCR_ENABLE    (1 << 7)
1388c2ecf20Sopenharmony_ci#  define SSI_CCR_SYNC_MASK  0x1f
1398c2ecf20Sopenharmony_ci#define SSI_GDD_CICR_REG(channel)  (0x804 + ((channel) * 0x40))
1408c2ecf20Sopenharmony_ci#  define SSI_BLOCK_IE    (1 << 5)
1418c2ecf20Sopenharmony_ci#  define SSI_HALF_IE    (1 << 2)
1428c2ecf20Sopenharmony_ci#  define SSI_TOUT_IE    (1 << 0)
1438c2ecf20Sopenharmony_ci#define SSI_GDD_CSR_REG(channel)  (0x806 + ((channel) * 0x40))
1448c2ecf20Sopenharmony_ci#  define SSI_CSR_SYNC    (1 << 6)
1458c2ecf20Sopenharmony_ci#  define SSI_CSR_BLOCK    (1 << 5)
1468c2ecf20Sopenharmony_ci#  define SSI_CSR_HALF    (1 << 2)
1478c2ecf20Sopenharmony_ci#  define SSI_CSR_TOUR    (1 << 0)
1488c2ecf20Sopenharmony_ci#define SSI_GDD_CSSA_REG(channel)  (0x808 + ((channel) * 0x40))
1498c2ecf20Sopenharmony_ci#define SSI_GDD_CDSA_REG(channel)  (0x80c + ((channel) * 0x40))
1508c2ecf20Sopenharmony_ci#define SSI_GDD_CEN_REG(channel)  (0x810 + ((channel) * 0x40))
1518c2ecf20Sopenharmony_ci#define SSI_GDD_CSAC_REG(channel)  (0x818 + ((channel) * 0x40))
1528c2ecf20Sopenharmony_ci#define SSI_GDD_CDAC_REG(channel)  (0x81a + ((channel) * 0x40))
1538c2ecf20Sopenharmony_ci#define SSI_GDD_CLNK_CTRL_REG(channel)  (0x828 + ((channel) * 0x40))
1548c2ecf20Sopenharmony_ci#  define SSI_ENABLE_LNK    (1 << 15)
1558c2ecf20Sopenharmony_ci#  define SSI_STOP_LNK    (1 << 14)
1568c2ecf20Sopenharmony_ci#  define SSI_NEXT_CH_ID_MASK  0xf
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci#endif /* __OMAP_SSI_REGS_H__ */
159