xref: /freebsd/sys/arm/ti/ti_scm.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1*af3dc4a7SPedro F. Giffuni /*-
2*af3dc4a7SPedro F. Giffuni  * SPDX-License-Identifier: BSD-4-Clause
3*af3dc4a7SPedro F. Giffuni  *
4e53470feSOleksandr Tymoshenko  * Copyright (c) 2010
5e53470feSOleksandr Tymoshenko  *	Ben Gray <ben.r.gray@gmail.com>.
6e53470feSOleksandr Tymoshenko  * All rights reserved.
7e53470feSOleksandr Tymoshenko  *
8e53470feSOleksandr Tymoshenko  * Redistribution and use in source and binary forms, with or without
9e53470feSOleksandr Tymoshenko  * modification, are permitted provided that the following conditions
10e53470feSOleksandr Tymoshenko  * are met:
11e53470feSOleksandr Tymoshenko  * 1. Redistributions of source code must retain the above copyright
12e53470feSOleksandr Tymoshenko  *    notice, this list of conditions and the following disclaimer.
13e53470feSOleksandr Tymoshenko  * 2. Redistributions in binary form must reproduce the above copyright
14e53470feSOleksandr Tymoshenko  *    notice, this list of conditions and the following disclaimer in the
15e53470feSOleksandr Tymoshenko  *    documentation and/or other materials provided with the distribution.
16e53470feSOleksandr Tymoshenko  * 3. All advertising materials mentioning features or use of this software
17e53470feSOleksandr Tymoshenko  *    must display the following acknowledgement:
18e53470feSOleksandr Tymoshenko  *	This product includes software developed by Ben Gray.
19e53470feSOleksandr Tymoshenko  * 4. The name of the company nor the name of the author may be used to
20e53470feSOleksandr Tymoshenko  *    endorse or promote products derived from this software without specific
21e53470feSOleksandr Tymoshenko  *    prior written permission.
22e53470feSOleksandr Tymoshenko  *
23e53470feSOleksandr Tymoshenko  * THIS SOFTWARE IS PROVIDED BY BEN GRAY ``AS IS'' AND ANY EXPRESS OR
24e53470feSOleksandr Tymoshenko  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25e53470feSOleksandr Tymoshenko  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26e53470feSOleksandr Tymoshenko  * IN NO EVENT SHALL BEN GRAY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27e53470feSOleksandr Tymoshenko  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28e53470feSOleksandr Tymoshenko  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
29e53470feSOleksandr Tymoshenko  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30e53470feSOleksandr Tymoshenko  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
31e53470feSOleksandr Tymoshenko  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32e53470feSOleksandr Tymoshenko  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33e53470feSOleksandr Tymoshenko  */
34e53470feSOleksandr Tymoshenko 
35e53470feSOleksandr Tymoshenko /**
36e53470feSOleksandr Tymoshenko  *	Functions to configure the PIN multiplexing on the chip.
37e53470feSOleksandr Tymoshenko  *
38e53470feSOleksandr Tymoshenko  *	This is different from the GPIO module in that it is used to configure the
39e53470feSOleksandr Tymoshenko  *	pins between modules not just GPIO input output.
40e53470feSOleksandr Tymoshenko  *
41e53470feSOleksandr Tymoshenko  */
42e53470feSOleksandr Tymoshenko #ifndef _TI_SCM_H_
43e53470feSOleksandr Tymoshenko #define _TI_SCM_H_
44e53470feSOleksandr Tymoshenko 
45e53470feSOleksandr Tymoshenko struct ti_scm_softc {
46e53470feSOleksandr Tymoshenko 	device_t		sc_dev;
47e53470feSOleksandr Tymoshenko 	struct resource *	sc_res[4];
48e53470feSOleksandr Tymoshenko 	bus_space_tag_t		sc_bst;
49e53470feSOleksandr Tymoshenko 	bus_space_handle_t	sc_bsh;
50e53470feSOleksandr Tymoshenko };
51e53470feSOleksandr Tymoshenko 
52e53470feSOleksandr Tymoshenko int ti_scm_reg_read_4(uint32_t reg, uint32_t *val);
53e53470feSOleksandr Tymoshenko int ti_scm_reg_write_4(uint32_t reg, uint32_t val);
54e53470feSOleksandr Tymoshenko 
55e53470feSOleksandr Tymoshenko #endif /* _TI_SCM_H_ */
56