Path: blob/master/drivers/gpu/host1x/hw/hw_host1x06_uclass.h
26493 views
/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Copyright (c) 2017 NVIDIA Corporation.3*/45/*6* Function naming determines intended use:7*8* <x>_r(void) : Returns the offset for register <x>.9*10* <x>_w(void) : Returns the word offset for word (4 byte) element <x>.11*12* <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.13*14* <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted15* and masked to place it at field <y> of register <x>. This value16* can be |'d with others to produce a full register value for17* register <x>.18*19* <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This20* value can be ~'d and then &'d to clear the value of field <y> for21* register <x>.22*23* <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted24* to place it at field <y> of register <x>. This value can be |'d25* with others to produce a full register value for <x>.26*27* <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register28* <x> value 'r' after being shifted to place its LSB at bit 0.29* This value is suitable for direct comparison with other unshifted30* values appropriate for use in field <y> of register <x>.31*32* <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for33* field <y> of register <x>. This value is suitable for direct34* comparison with unshifted values appropriate for use in field <y>35* of register <x>.36*/3738#ifndef HOST1X_HW_HOST1X06_UCLASS_H39#define HOST1X_HW_HOST1X06_UCLASS_H4041static inline u32 host1x_uclass_incr_syncpt_r(void)42{43return 0x0;44}45#define HOST1X_UCLASS_INCR_SYNCPT \46host1x_uclass_incr_syncpt_r()47static inline u32 host1x_uclass_incr_syncpt_cond_f(u32 v)48{49return (v & 0xff) << 10;50}51#define HOST1X_UCLASS_INCR_SYNCPT_COND_F(v) \52host1x_uclass_incr_syncpt_cond_f(v)53static inline u32 host1x_uclass_incr_syncpt_indx_f(u32 v)54{55return (v & 0x3ff) << 0;56}57#define HOST1X_UCLASS_INCR_SYNCPT_INDX_F(v) \58host1x_uclass_incr_syncpt_indx_f(v)59static inline u32 host1x_uclass_wait_syncpt_r(void)60{61return 0x8;62}63#define HOST1X_UCLASS_WAIT_SYNCPT \64host1x_uclass_wait_syncpt_r()65static inline u32 host1x_uclass_wait_syncpt_indx_f(u32 v)66{67return (v & 0xff) << 24;68}69#define HOST1X_UCLASS_WAIT_SYNCPT_INDX_F(v) \70host1x_uclass_wait_syncpt_indx_f(v)71static inline u32 host1x_uclass_wait_syncpt_thresh_f(u32 v)72{73return (v & 0xffffff) << 0;74}75#define HOST1X_UCLASS_WAIT_SYNCPT_THRESH_F(v) \76host1x_uclass_wait_syncpt_thresh_f(v)77static inline u32 host1x_uclass_wait_syncpt_base_r(void)78{79return 0x9;80}81#define HOST1X_UCLASS_WAIT_SYNCPT_BASE \82host1x_uclass_wait_syncpt_base_r()83static inline u32 host1x_uclass_wait_syncpt_base_indx_f(u32 v)84{85return (v & 0xff) << 24;86}87#define HOST1X_UCLASS_WAIT_SYNCPT_BASE_INDX_F(v) \88host1x_uclass_wait_syncpt_base_indx_f(v)89static inline u32 host1x_uclass_wait_syncpt_base_base_indx_f(u32 v)90{91return (v & 0xff) << 16;92}93#define HOST1X_UCLASS_WAIT_SYNCPT_BASE_BASE_INDX_F(v) \94host1x_uclass_wait_syncpt_base_base_indx_f(v)95static inline u32 host1x_uclass_wait_syncpt_base_offset_f(u32 v)96{97return (v & 0xffff) << 0;98}99#define HOST1X_UCLASS_WAIT_SYNCPT_BASE_OFFSET_F(v) \100host1x_uclass_wait_syncpt_base_offset_f(v)101static inline u32 host1x_uclass_load_syncpt_base_r(void)102{103return 0xb;104}105#define HOST1X_UCLASS_LOAD_SYNCPT_BASE \106host1x_uclass_load_syncpt_base_r()107static inline u32 host1x_uclass_load_syncpt_base_base_indx_f(u32 v)108{109return (v & 0xff) << 24;110}111#define HOST1X_UCLASS_LOAD_SYNCPT_BASE_BASE_INDX_F(v) \112host1x_uclass_load_syncpt_base_base_indx_f(v)113static inline u32 host1x_uclass_load_syncpt_base_value_f(u32 v)114{115return (v & 0xffffff) << 0;116}117#define HOST1X_UCLASS_LOAD_SYNCPT_BASE_VALUE_F(v) \118host1x_uclass_load_syncpt_base_value_f(v)119static inline u32 host1x_uclass_incr_syncpt_base_base_indx_f(u32 v)120{121return (v & 0xff) << 24;122}123#define HOST1X_UCLASS_INCR_SYNCPT_BASE_BASE_INDX_F(v) \124host1x_uclass_incr_syncpt_base_base_indx_f(v)125static inline u32 host1x_uclass_incr_syncpt_base_offset_f(u32 v)126{127return (v & 0xffffff) << 0;128}129#define HOST1X_UCLASS_INCR_SYNCPT_BASE_OFFSET_F(v) \130host1x_uclass_incr_syncpt_base_offset_f(v)131static inline u32 host1x_uclass_indoff_r(void)132{133return 0x2d;134}135#define HOST1X_UCLASS_INDOFF \136host1x_uclass_indoff_r()137static inline u32 host1x_uclass_indoff_indbe_f(u32 v)138{139return (v & 0xf) << 28;140}141#define HOST1X_UCLASS_INDOFF_INDBE_F(v) \142host1x_uclass_indoff_indbe_f(v)143static inline u32 host1x_uclass_indoff_autoinc_f(u32 v)144{145return (v & 0x1) << 27;146}147#define HOST1X_UCLASS_INDOFF_AUTOINC_F(v) \148host1x_uclass_indoff_autoinc_f(v)149static inline u32 host1x_uclass_indoff_indmodid_f(u32 v)150{151return (v & 0xff) << 18;152}153#define HOST1X_UCLASS_INDOFF_INDMODID_F(v) \154host1x_uclass_indoff_indmodid_f(v)155static inline u32 host1x_uclass_indoff_indroffset_f(u32 v)156{157return (v & 0xffff) << 2;158}159#define HOST1X_UCLASS_INDOFF_INDROFFSET_F(v) \160host1x_uclass_indoff_indroffset_f(v)161static inline u32 host1x_uclass_indoff_rwn_read_v(void)162{163return 1;164}165#define HOST1X_UCLASS_INDOFF_INDROFFSET_F(v) \166host1x_uclass_indoff_indroffset_f(v)167static inline u32 host1x_uclass_load_syncpt_payload_32_r(void)168{169return 0x4e;170}171#define HOST1X_UCLASS_LOAD_SYNCPT_PAYLOAD_32 \172host1x_uclass_load_syncpt_payload_32_r()173static inline u32 host1x_uclass_wait_syncpt_32_r(void)174{175return 0x50;176}177#define HOST1X_UCLASS_WAIT_SYNCPT_32 \178host1x_uclass_wait_syncpt_32_r()179180#endif181182183