Skip to content

Commit 0a4b8c4

Browse files
committed
media: atomisp: simplify IRQ ifdef logic
There are lots of mess with IRQ ifdef settings. As the *_global.h will already detect the type of IRQ system at compile time, we can get rid of them, replacing by just one ifdef for ISP2401. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent d0b674a commit 0a4b8c4

File tree

9 files changed

+2
-120
lines changed

9 files changed

+2
-120
lines changed

drivers/staging/media/atomisp/pci/hive_isp_css_common/isp_global.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,10 @@
1818

1919
#include <system_local.h>
2020

21-
#if defined(HAS_ISP_2401_MAMOIADA)
22-
#define IS_ISP_2401_MAMOIADA
23-
21+
#ifdef ISP2401
2422
#include "isp2401_mamoiada_params.h"
25-
#elif defined(HAS_ISP_2400_MAMOIADA)
26-
#define IS_ISP_2400_MAMOIADA
27-
28-
#include "isp2400_mamoiada_params.h"
2923
#else
30-
#error "isp_global_h: ISP_2400_MAMOIDA must be one of {2400, 2401 }"
24+
#include "isp2400_mamoiada_params.h"
3125
#endif
3226

3327
#define ISP_PMEM_WIDTH_LOG2 ISP_LOG2_PMEM_WIDTH

drivers/staging/media/atomisp/pci/hive_isp_css_common/sp_global.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,7 @@
1818

1919
#include <system_local.h>
2020

21-
#if defined(HAS_SP_2401)
22-
#define IS_SP_2401
23-
/* 2401 uses 2400 */
2421
#include <scalar_processor_2400_params.h>
25-
#elif defined(HAS_SP_2400)
26-
#define IS_SP_2400
27-
28-
#include <scalar_processor_2400_params.h>
29-
#else
30-
#error "sp_global.h: SP_2400 must be one of {2400, 2401 }"
31-
#endif
3222

3323
#define SP_PMEM_WIDTH_LOG2 SP_PMEM_LOG_WIDTH_BITS
3424
#define SP_PMEM_SIZE SP_PMEM_DEPTH

drivers/staging/media/atomisp/pci/isp2400_system_global.h

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,6 @@
4747
* N.B. the 3 input formatters are of 2 different classess
4848
*/
4949

50-
/*
51-
* Since this file is visible everywhere and the system definition
52-
* macros are not, detect the separate definitions for {host, SP, ISP}
53-
*
54-
* The 2401 system has the nice property that it uses a vanilla 2400 SP
55-
* so the SP will believe it is a 2400 system rather than 2401...
56-
*/
57-
//#if defined(SYSTEM_hive_isp_css_2401_system) || defined(__isp2401_mamoiada) || defined(__scalar_processor_2401)
58-
#if defined(SYSTEM_hive_isp_css_2401_system) || defined(__isp2401_mamoiada)
59-
#define IS_ISP_2401_MAMOIADA_SYSTEM
60-
#define HAS_ISP_2401_MAMOIADA
61-
#define HAS_SP_2400
62-
//#elif defined(SYSTEM_hive_isp_css_2400_system) || defined(__isp2400_mamoiada) || defined(__scalar_processor_2400)
63-
#elif defined(SYSTEM_hive_isp_css_2400_system) || defined(__isp2400_mamoiada)
64-
#define IS_ISP_2400_MAMOIADA_SYSTEM
65-
#define HAS_ISP_2400_MAMOIADA
66-
#define HAS_SP_2400
67-
#else
68-
#error "system_global.h: 2400_SYSTEM must be one of {2400, 2401 }"
69-
#endif
70-
7150
#define USE_INPUT_SYSTEM_VERSION_2
7251

7352
#define HAS_MMU_VERSION_2
@@ -130,21 +109,11 @@ typedef enum {
130109
N_SP_ID
131110
} sp_ID_t;
132111

133-
#if defined(IS_ISP_2401_MAMOIADA_SYSTEM)
134112
typedef enum {
135113
MMU0_ID = 0,
136114
MMU1_ID,
137115
N_MMU_ID
138116
} mmu_ID_t;
139-
#elif defined(IS_ISP_2400_MAMOIADA_SYSTEM)
140-
typedef enum {
141-
MMU0_ID = 0,
142-
MMU1_ID,
143-
N_MMU_ID
144-
} mmu_ID_t;
145-
#else
146-
#error "system_global.h: SYSTEM must be one of {2400, 2401}"
147-
#endif
148117

149118
typedef enum {
150119
DMA0_ID = 0,

drivers/staging/media/atomisp/pci/isp2400_system_local.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ static const hrt_address SP_PMEM_BASE[N_SP_ID] = {
8282
};
8383

8484
/* MMU */
85-
#if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
8685
/*
8786
* MMU0_ID: The data MMU
8887
* MMU1_ID: The icache MMU
@@ -91,9 +90,6 @@ static const hrt_address MMU_BASE[N_MMU_ID] = {
9190
(hrt_address)0x0000000000070000ULL,
9291
(hrt_address)0x00000000000A0000ULL
9392
};
94-
#else
95-
#error "system_local.h: SYSTEM must be one of {2400, 2401 }"
96-
#endif
9793

9894
/* DMA */
9995
static const hrt_address DMA_BASE[N_DMA_ID] = {
@@ -225,7 +221,6 @@ static const hrt_address SP_PMEM_BASE[N_SP_ID] = {
225221
};
226222

227223
/* MMU */
228-
#if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
229224
/*
230225
* MMU0_ID: The data MMU
231226
* MMU1_ID: The icache MMU
@@ -234,9 +229,6 @@ static const hrt_address MMU_BASE[N_MMU_ID] = {
234229
(hrt_address)0x00070000UL,
235230
(hrt_address)0x000A0000UL
236231
};
237-
#else
238-
#error "system_local.h: SYSTEM must be one of {2400, 2401 }"
239-
#endif
240232

241233
/* DMA */
242234
static const hrt_address DMA_BASE[N_DMA_ID] = {

drivers/staging/media/atomisp/pci/isp2401_system_global.h

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -53,27 +53,6 @@
5353

5454
#define USE_INPUT_SYSTEM_VERSION_2401
5555

56-
/*
57-
* Since this file is visible everywhere and the system definition
58-
* macros are not, detect the separate definitions for {host, SP, ISP}
59-
*
60-
* The 2401 system has the nice property that it uses a vanilla 2400 SP
61-
* so the SP will believe it is a 2400 system rather than 2401...
62-
*/
63-
/* #if defined(SYSTEM_hive_isp_css_2401_system) || defined(__isp2401_mamoiada) || defined(__scalar_processor_2401) */
64-
#if defined(SYSTEM_hive_isp_css_2401_system) || defined(__isp2401_mamoiada)
65-
#define IS_ISP_2401_MAMOIADA_SYSTEM
66-
#define HAS_ISP_2401_MAMOIADA
67-
#define HAS_SP_2400
68-
/* #elif defined(SYSTEM_hive_isp_css_2400_system) || defined(__isp2400_mamoiada) || defined(__scalar_processor_2400)*/
69-
#elif defined(SYSTEM_hive_isp_css_2400_system) || defined(__isp2400_mamoiada)
70-
#define IS_ISP_2400_MAMOIADA_SYSTEM
71-
#define HAS_ISP_2400_MAMOIADA
72-
#define HAS_SP_2400
73-
#else
74-
#error "system_global.h: 2400_SYSTEM must be one of {2400, 2401 }"
75-
#endif
76-
7756
#define HAS_MMU_VERSION_2
7857
#define HAS_DMA_VERSION_2
7958
#define HAS_GDC_VERSION_2
@@ -144,21 +123,11 @@ typedef enum {
144123
N_SP_ID
145124
} sp_ID_t;
146125

147-
#if defined(IS_ISP_2401_MAMOIADA_SYSTEM)
148-
typedef enum {
149-
MMU0_ID = 0,
150-
MMU1_ID,
151-
N_MMU_ID
152-
} mmu_ID_t;
153-
#elif defined(IS_ISP_2400_MAMOIADA_SYSTEM)
154126
typedef enum {
155127
MMU0_ID = 0,
156128
MMU1_ID,
157129
N_MMU_ID
158130
} mmu_ID_t;
159-
#else
160-
#error "system_global.h: SYSTEM must be one of {2400, 2401}"
161-
#endif
162131

163132
typedef enum {
164133
DMA0_ID = 0,

drivers/staging/media/atomisp/pci/isp2401_system_local.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
7676
};
7777

7878
/* MMU */
79-
#if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
8079
/*
8180
* MMU0_ID: The data MMU
8281
* MMU1_ID: The icache MMU
@@ -85,9 +84,6 @@ static const hrt_address MMU_BASE[N_MMU_ID] = {
8584
0x0000000000070000ULL,
8685
0x00000000000A0000ULL
8786
};
88-
#else
89-
#error "system_local.h: SYSTEM must be one of {2400, 2401 }"
90-
#endif
9187

9288
/* DMA */
9389
static const hrt_address DMA_BASE[N_DMA_ID] = {
@@ -261,7 +257,6 @@ static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
261257
};
262258

263259
/* MMU */
264-
#if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
265260
/*
266261
* MMU0_ID: The data MMU
267262
* MMU1_ID: The icache MMU
@@ -270,9 +265,6 @@ static const hrt_address MMU_BASE[N_MMU_ID] = {
270265
0x00070000UL,
271266
0x000A0000UL
272267
};
273-
#else
274-
#error "system_local.h: SYSTEM must be one of {2400, 2401 }"
275-
#endif
276268

277269
/* DMA */
278270
static const hrt_address DMA_BASE[N_DMA_ID] = {

drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ void ia_css_debug_dump_isp_state(void)
460460
#endif
461461
ia_css_debug_dtrace(2, "\t%-32s: %d\n", "[2] dma_FIFO stalled",
462462
stall.fifo2);
463-
#if defined(HAS_ISP_2400_MAMOIADA) || defined(HAS_ISP_2401_MAMOIADA) || defined(IS_ISP_2500_SYSTEM)
464463

465464
ia_css_debug_dtrace(2, "\t%-32s: %d\n", "[3] gdc0_FIFO stalled",
466465
stall.fifo3);
@@ -472,9 +471,6 @@ void ia_css_debug_dump_isp_state(void)
472471
#endif
473472
ia_css_debug_dtrace(2, "\t%-32s: %d\n", "[6] sp_FIFO stalled",
474473
stall.fifo6);
475-
#else
476-
#error "ia_css_debug: ISP cell must be one of {2400_MAMOIADA,, 2401_MAMOIADA, 2500_SKYCAM}"
477-
#endif
478474
ia_css_debug_dtrace(2, "\t%-32s: %d\n",
479475
"status & control stalled",
480476
stall.stat_ctrl);
@@ -486,14 +482,12 @@ void ia_css_debug_dump_isp_state(void)
486482
stall.vamem1);
487483
ia_css_debug_dtrace(2, "\t%-32s: %d\n", "vamem2 stalled",
488484
stall.vamem2);
489-
#if defined(HAS_ISP_2400_MAMOIADA) || defined(HAS_ISP_2401_MAMOIADA)
490485
ia_css_debug_dtrace(2, "\t%-32s: %d\n", "vamem3 stalled",
491486
stall.vamem3);
492487
ia_css_debug_dtrace(2, "\t%-32s: %d\n", "hmem stalled",
493488
stall.hmem);
494489
ia_css_debug_dtrace(2, "\t%-32s: %d\n", "pmem stalled",
495490
stall.pmem);
496-
#endif
497491
}
498492
return;
499493
}
@@ -506,7 +500,6 @@ void ia_css_debug_dump_sp_state(void)
506500
sp_get_state(SP0_ID, &state, &stall);
507501
debug_print_sp_state(&state, "SP");
508502
if (state.is_stalling) {
509-
#if defined(HAS_SP_2400) || defined(IS_ISP_2500_SYSTEM)
510503
#if !defined(HAS_NO_INPUT_SYSTEM)
511504
ia_css_debug_dtrace(2, "\t%-32s: %d\n", "isys_FIFO stalled",
512505
stall.fifo0);
@@ -537,9 +530,6 @@ void ia_css_debug_dump_sp_state(void)
537530
#endif
538531
ia_css_debug_dtrace(2, "\t%-32s: %d\n", "irq FIFO stalled",
539532
stall.fifoa);
540-
#else
541-
#error "ia_css_debug: SP cell must be one of {SP2400, SP2500}"
542-
#endif
543533
ia_css_debug_dtrace(2, "\t%-32s: %d\n", "dmem stalled",
544534
stall.dmem);
545535
ia_css_debug_dtrace(2, "\t%-32s: %d\n",

drivers/staging/media/atomisp/pci/runtime/tagger/interface/ia_css_tagger_common.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@
2424
*
2525
* Should be one less than NUM_CONTINUOUS_FRAMES in sh_css_internal.h
2626
*/
27-
#if defined(HAS_SP_2400)
2827
#define MAX_CB_ELEMS_FOR_TAGGER 14
29-
#else
30-
#define MAX_CB_ELEMS_FOR_TAGGER 9
31-
#endif
3228

3329
/**
3430
* @brief Data structure for the tagger buffer element.

drivers/staging/media/atomisp/pci/sh_css_internal.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,7 @@
7676
#define SH_CSS_REF_BIT_DEPTH 8
7777

7878
/* keep next up to date with the definition for MAX_CB_ELEMS_FOR_TAGGER in tagger.sp.c */
79-
#if defined(HAS_SP_2400)
8079
#define NUM_CONTINUOUS_FRAMES 15
81-
#else
82-
#define NUM_CONTINUOUS_FRAMES 10
83-
#endif
8480
#define NUM_MIPI_FRAMES_PER_STREAM 2
8581

8682
#define NUM_ONLINE_INIT_CONTINUOUS_FRAMES 2
@@ -729,15 +725,9 @@ struct sh_css_sp_output {
729725
* separate SP thread for this. */
730726
#define IA_CSS_NUM_ELEMS_HOST2SP_ISYS_EVENT_QUEUE (2 * N_CSI_PORTS)
731727

732-
#if defined(HAS_SP_2400)
733728
#define IA_CSS_NUM_ELEMS_HOST2SP_PSYS_EVENT_QUEUE 13
734729
#define IA_CSS_NUM_ELEMS_SP2HOST_BUFFER_QUEUE 19
735730
#define IA_CSS_NUM_ELEMS_SP2HOST_PSYS_EVENT_QUEUE 26 /* holds events for all type of buffers, hence deeper */
736-
#else
737-
#define IA_CSS_NUM_ELEMS_HOST2SP_PSYS_EVENT_QUEUE 6
738-
#define IA_CSS_NUM_ELEMS_SP2HOST_BUFFER_QUEUE 6
739-
#define IA_CSS_NUM_ELEMS_SP2HOST_PSYS_EVENT_QUEUE 6
740-
#endif
741731

742732
struct sh_css_hmm_buffer {
743733
union {

0 commit comments

Comments
 (0)