|
| 1 | +/**************************************************************************** |
| 2 | + * arch/tricore/src/tc4xx/hardware/tc4xx_clock.h |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + * |
| 6 | + * Licensed to the Apache Software Foundation (ASF) under one or more |
| 7 | + * contributor license agreements. See the NOTICE file distributed with |
| 8 | + * this work for additional information regarding copyright ownership. The |
| 9 | + * ASF licenses this file to you under the Apache License, Version 2.0 (the |
| 10 | + * "License"); you may not use this file except in compliance with the |
| 11 | + * License. You may obtain a copy of the License at |
| 12 | + * |
| 13 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | + * |
| 15 | + * Unless required by applicable law or agreed to in writing, software |
| 16 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 17 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 18 | + * License for the specific language governing permissions and limitations |
| 19 | + * under the License. |
| 20 | + * |
| 21 | + ****************************************************************************/ |
| 22 | + |
| 23 | +#ifndef __ARCH_TRICORE_SRC_TC4XX_HARDWARE_TC4XX_CLOCK_H |
| 24 | +#define __ARCH_TRICORE_SRC_TC4XX_HARDWARE_TC4XX_CLOCK_H |
| 25 | + |
| 26 | +/**************************************************************************** |
| 27 | + * Pre-processor Definitions |
| 28 | + ****************************************************************************/ |
| 29 | + |
| 30 | +/* Clock module registers */ |
| 31 | + |
| 32 | +#define TC4XX_CLOCK_OSCCON 0xf0064100 |
| 33 | +#define TC4XX_CLOCK_RAMPCON0 0xf0064200 |
| 34 | +#define TC4XX_CLOCK_RAMPSTAT 0xf006420c |
| 35 | +#define TC4XX_CLOCK_SYSPLLCON0 0xf0064300 |
| 36 | +#define TC4XX_CLOCK_SYSPLLCON1 0xf0064304 |
| 37 | +#define TC4XX_CLOCK_SYSPLLSTAT 0xf006430c |
| 38 | +#define TC4XX_CLOCK_PERPLLCON0 0xf0064380 |
| 39 | +#define TC4XX_CLOCK_PERPLLCON1 0xf0064384 |
| 40 | +#define TC4XX_CLOCK_PERPLLSTAT 0xf006438c |
| 41 | +#define TC4XX_CLOCK_CCUCON 0xf0064400 |
| 42 | +#define TC4XX_CLOCK_CCUSTAT 0xf0064404 |
| 43 | +#define TC4XX_CLOCK_SYSCCUCON0 0xf0064410 |
| 44 | +#define TC4XX_CLOCK_SYSCCUCON1 0xf0064414 |
| 45 | +#define TC4XX_CLOCK_PERCCUCON0 0xf0064420 |
| 46 | +#define TC4XX_CLOCK_PERCCUCON1 0xf0064424 |
| 47 | +#define TC4XX_CLOCK_OSCMON1 0xf0064508 |
| 48 | +#define TC4XX_CLOCK_OSCSTAT 0xf006450c |
| 49 | +#define TC4XX_CLOCK_RAMPMON 0xf0064510 |
| 50 | + |
| 51 | +#define TC4XX_OSCCON_MODE_SHIFT 8 |
| 52 | +#define TC4XX_OSCCON_MODE_MASK (0x7 << TC4XX_OSCCON_MODE_SHIFT) |
| 53 | +#define TC4XX_OSCCON_INSEL_SHIFT 24 |
| 54 | +#define TC4XX_OSCCON_INSEL_MASK (0x3 << TC4XX_OSCCON_INSEL_SHIFT) |
| 55 | + |
| 56 | +#define TC4XX_OSCMON1_OSCVAL_MASK (0x7f << 0) |
| 57 | +#define TC4XX_OSCMON1_SMONEN (1 << 8) |
| 58 | +#define TC4XX_OSCMON1_PMONEN (1 << 24) |
| 59 | +#define TC4XX_OSCSTAT_WDS_MASK ((0x3 << 0) | (0x3 << 16)) |
| 60 | + |
| 61 | +#define TC4XX_RAMPCON0_UFL_MASK (0x3ff << 0) |
| 62 | +#define TC4XX_RAMPCON0_CMD_SHIFT 16 |
| 63 | +#define TC4XX_RAMPCON0_CMD_MASK (0x7 << TC4XX_RAMPCON0_CMD_SHIFT) |
| 64 | +#define TC4XX_RAMPCON0_PWR (1 << 19) |
| 65 | +#define TC4XX_RAMPSTAT_FSTAT_SHIFT 16 |
| 66 | +#define TC4XX_RAMPSTAT_FSTAT_MASK (0x3 << TC4XX_RAMPSTAT_FSTAT_SHIFT) |
| 67 | +#define TC4XX_RAMPSTAT_ACTIVE (1 << 23) |
| 68 | +#define TC4XX_RAMPSTAT_FLLLOCK (1 << 24) |
| 69 | +#define TC4XX_RAMPMON_FLLLDEN (1 << 28) |
| 70 | + |
| 71 | +#define TC4XX_PLLCON0_PLLPWR (1 << 0) |
| 72 | +#define TC4XX_PLLCON0_NDIV_SHIFT 8 |
| 73 | +#define TC4XX_PLLCON0_NDIV_MASK (0x7f << TC4XX_PLLCON0_NDIV_SHIFT) |
| 74 | +#define TC4XX_PLLCON0_PDIV_SHIFT 16 |
| 75 | +#define TC4XX_PLLCON0_PDIV_MASK (0x7 << TC4XX_PLLCON0_PDIV_SHIFT) |
| 76 | +#define TC4XX_PLLSTAT_PWRSTAT (1 << 0) |
| 77 | +#define TC4XX_PLLSTAT_PLLLOCK (1 << 1) |
| 78 | + |
| 79 | +#define TC4XX_PLLCON1_K2DIV_MASK (0xf << 0) |
| 80 | +#define TC4XX_PLLCON1_K2PRE_SHIFT 4 |
| 81 | +#define TC4XX_PLLCON1_K2PRE_MASK (0x3 << TC4XX_PLLCON1_K2PRE_SHIFT) |
| 82 | +#define TC4XX_PLLCON1_K3DIV_SHIFT 8 |
| 83 | +#define TC4XX_PLLCON1_K3DIV_MASK (0x7 << TC4XX_PLLCON1_K3DIV_SHIFT) |
| 84 | +#define TC4XX_PLLCON1_K3PRE_SHIFT 12 |
| 85 | +#define TC4XX_PLLCON1_K3PRE_MASK (0xf << TC4XX_PLLCON1_K3PRE_SHIFT) |
| 86 | +#define TC4XX_PLLCON1_K4DIV_SHIFT 16 /* PERPLLCON1 only */ |
| 87 | +#define TC4XX_PLLCON1_K4DIV_MASK (0x7 << TC4XX_PLLCON1_K4DIV_SHIFT) |
| 88 | +#define TC4XX_PLLCON1_K4PRE_SHIFT 20 /* PERPLLCON1 only */ |
| 89 | +#define TC4XX_PLLCON1_K4PRE_MASK (0x3 << TC4XX_PLLCON1_K4PRE_SHIFT) |
| 90 | + |
| 91 | +#define TC4XX_CCUSTAT_LCK (1 << 31) |
| 92 | +#define TC4XX_CCU_CLKSELS_MASK (0x3 << 0) /* CCUCON and CCUSTAT */ |
| 93 | +#define TC4XX_CCU_CLKSELS_PLL 0 |
| 94 | +#define TC4XX_CCU_CLKSELS_BACK 1 |
| 95 | +#define TC4XX_CCU_CLKSELS_RAMP 2 |
| 96 | +#define TC4XX_CCU_CLKSELP (1 << 16) /* Set: backup clock */ |
| 97 | +#define TC4XX_CCUCON_UP (1 << 30) /* SYSCCUCON0 and 1 */ |
| 98 | + |
| 99 | +#endif /* __ARCH_TRICORE_SRC_TC4XX_HARDWARE_TC4XX_CLOCK_H */ |
0 commit comments