qemu/include/hw/misc/imx6_src.h
Eduardo Habkost db1015e92e Move QOM typedefs and add missing includes
Some typedefs and macros are defined after the type check macros.
This makes it difficult to automatically replace their
definitions with OBJECT_DECLARE_TYPE.

Patch generated using:

 $ ./scripts/codeconverter/converter.py -i \
   --pattern=QOMStructTypedefSplit $(git grep -l '' -- '*.[ch]')

which will split "typdef struct { ... } TypedefName"
declarations.

Followed by:

 $ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \
    $(git grep -l '' -- '*.[ch]')

which will:
- move the typedefs and #defines above the type check macros
- add missing #include "qom/object.h" lines if necessary

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20200831210740.126168-9-ehabkost@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20200831210740.126168-10-ehabkost@redhat.com>
Message-Id: <20200831210740.126168-11-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-09 09:26:43 -04:00

76 lines
1.7 KiB
C

/*
* IMX6 System Reset Controller
*
* Copyright (C) 2012 NICTA
* Updated by Jean-Christophe Dubois <jcd@tribudubois.net>
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/
#ifndef IMX6_SRC_H
#define IMX6_SRC_H
#include "hw/sysbus.h"
#include "qemu/bitops.h"
#include "qom/object.h"
#define SRC_SCR 0
#define SRC_SBMR1 1
#define SRC_SRSR 2
#define SRC_SISR 5
#define SRC_SIMR 6
#define SRC_SBMR2 7
#define SRC_GPR1 8
#define SRC_GPR2 9
#define SRC_GPR3 10
#define SRC_GPR4 11
#define SRC_GPR5 12
#define SRC_GPR6 13
#define SRC_GPR7 14
#define SRC_GPR8 15
#define SRC_GPR9 16
#define SRC_GPR10 17
#define SRC_MAX 18
/* SRC_SCR */
#define CORE3_ENABLE_SHIFT 24
#define CORE3_ENABLE_LENGTH 1
#define CORE2_ENABLE_SHIFT 23
#define CORE2_ENABLE_LENGTH 1
#define CORE1_ENABLE_SHIFT 22
#define CORE1_ENABLE_LENGTH 1
#define CORE3_RST_SHIFT 16
#define CORE3_RST_LENGTH 1
#define CORE2_RST_SHIFT 15
#define CORE2_RST_LENGTH 1
#define CORE1_RST_SHIFT 14
#define CORE1_RST_LENGTH 1
#define CORE0_RST_SHIFT 13
#define CORE0_RST_LENGTH 1
#define SW_IPU1_RST_SHIFT 3
#define SW_IPU1_RST_LENGTH 1
#define SW_IPU2_RST_SHIFT 12
#define SW_IPU2_RST_LENGTH 1
#define WARM_RST_ENABLE_SHIFT 0
#define WARM_RST_ENABLE_LENGTH 1
#define EXTRACT(value, name) extract32(value, name##_SHIFT, name##_LENGTH)
#define TYPE_IMX6_SRC "imx6.src"
typedef struct IMX6SRCState IMX6SRCState;
#define IMX6_SRC(obj) OBJECT_CHECK(IMX6SRCState, (obj), TYPE_IMX6_SRC)
struct IMX6SRCState {
/* <private> */
SysBusDevice parent_obj;
/* <public> */
MemoryRegion iomem;
uint32_t regs[SRC_MAX];
};
#endif /* IMX6_SRC_H */