Project

General

Profile

Code-audit » History » Version 6

gnutoo, 02/19/2016 10:49 PM

1 1 gnutoo
== Introduction ==
2
This is an audit to verify that The headers are correct(for instance that the code wasn't took from osmocom-bb and then relicensed without permission under the BSD license with the authorship stripped).
3
With the code size of nuttx-bb the audit should be quick enough.
4
5 2 gnutoo
That will also permit us to look at the license of each files in order to aim for upstream inclusion in nuttx(nuttx only accept BSD licensed code)
6 1 gnutoo
== Audit ==
7
Currently the following files were added or modified by nuttx-bb(on top of nuttx):
8
{{{
9
 apps/examples/calypsotest/Makefile             
10
 apps/examples/calypsotest/bounce_analyze.c     
11
 apps/examples/calypsotest/main.c               
12
 apps/examples/ostest/main.c                    
13
 nuttx/arch/arm/include/calypso/armio.h         
14
 nuttx/arch/arm/include/calypso/clock.h         
15
 nuttx/arch/arm/include/calypso/debug.h         
16
 nuttx/arch/arm/include/calypso/defines.h       
17
 nuttx/arch/arm/include/calypso/irq.h           
18
 nuttx/arch/arm/include/calypso/memory.h        
19
 nuttx/arch/arm/include/calypso/timer.h         
20
 nuttx/arch/arm/src/Makefile                    
21
 nuttx/arch/arm/src/calypso/Make.defs           
22
 nuttx/arch/arm/src/calypso/calypso_armio.c     
23
 nuttx/arch/arm/src/calypso/calypso_head.S      
24
 nuttx/arch/arm/src/calypso/calypso_heap.c      
25
 nuttx/arch/arm/src/calypso/calypso_irq.c       
26
 nuttx/arch/arm/src/calypso/calypso_keypad.c    
27
 nuttx/arch/arm/src/calypso/calypso_lowputc.S   
28
 nuttx/arch/arm/src/calypso/calypso_serial.c    
29 6 gnutoo
 nuttx/arch/arm/src/calypso/calypso_spi.c       OK,BSD, wrapper arround osmocombb's SPI, incomplete
30 1 gnutoo
 nuttx/arch/arm/src/calypso/calypso_timer.c     
31
 nuttx/arch/arm/src/calypso/chip.h              
32
 nuttx/arch/arm/src/calypso/clock.c             
33
 nuttx/arch/arm/src/common/up_internal.h        
34 3 gnutoo
 nuttx/configs/compal_e88/calypsotest/Make.defs OK,BSD
35
 nuttx/configs/compal_e88/calypsotest/appconfig OK,BSD
36
 nuttx/configs/compal_e88/calypsotest/defconfig OK,BSD
37
 nuttx/configs/compal_e88/calypsotest/setenv.sh OK,BSD
38
 nuttx/configs/compal_e88/include/board.h       OK,BSD
39
 nuttx/configs/compal_e88/ld.script             OK,BSD
40
 nuttx/configs/compal_e88/nsh/Make.defs         OK,BSD
41
 nuttx/configs/compal_e88/nsh/appconfig         OK,BSD
42
 nuttx/configs/compal_e88/nsh/defconfig         OK,BSD
43
 nuttx/configs/compal_e88/nsh/ld.script         OK,BSD
44
 nuttx/configs/compal_e88/nsh/setenv.sh         OK,BSD
45
 nuttx/configs/compal_e88/ostest/Make.defs      OK,BSD
46
 nuttx/configs/compal_e88/ostest/appconfig      OK,BSD
47
 nuttx/configs/compal_e88/ostest/defconfig      OK,BSD
48
 nuttx/configs/compal_e88/ostest/setenv.sh      OK,BSD
49
 nuttx/configs/compal_e88/src/Make.dep          OK,BSD
50
 nuttx/configs/compal_e88/src/Makefile          OK,BSD
51
 nuttx/configs/compal_e88/src/dummy.c           OK,BSD
52
 nuttx/configs/compal_e99/calypsotest/Make.defs OK,BSD
53
 nuttx/configs/compal_e99/calypsotest/appconfig OK,BSD
54
 nuttx/configs/compal_e99/calypsotest/defconfig OK,BSD
55
 nuttx/configs/compal_e99/calypsotest/setenv.sh OK,BSD
56
 nuttx/configs/compal_e99/include/board.h       OK,BSD
57
 nuttx/configs/compal_e99/ld.script             OK,BSD
58
 nuttx/configs/compal_e99/nsh/Make.defs         OK,BSD
59
 nuttx/configs/compal_e99/nsh/appconfig         OK,BSD
60
 nuttx/configs/compal_e99/nsh/defconfig         OK,BSD
61
 nuttx/configs/compal_e99/nsh/ld.script         OK,BSD
62
 nuttx/configs/compal_e99/nsh/setenv.sh         OK,BSD
63
 nuttx/configs/compal_e99/ostest/Make.defs      OK,BSD
64
 nuttx/configs/compal_e99/ostest/appconfig      OK,BSD
65
 nuttx/configs/compal_e99/ostest/defconfig      OK,BSD
66
 nuttx/configs/compal_e99/ostest/setenv.sh      OK,BSD
67
 nuttx/configs/compal_e99/src/Makefile          OK,BSD
68
 nuttx/configs/compal_e99/src/dummy.c           OK,BSD
69 1 gnutoo
 nuttx/drivers/Makefile                         
70
 nuttx/drivers/sercomm/Make.defs                
71
 nuttx/drivers/sercomm/console.c                
72 5 gnutoo
 nuttx/drivers/sercomm/loadwriter.py            no copyright at all, small enough
73 4 gnutoo
 nuttx/drivers/sercomm/uart.c                   OK,GPL, copyright Harald Welte and Ingo Albrecht
74
 nuttx/drivers/sercomm/uart.h                   no copyright at all
75 5 gnutoo
 nuttx/include/nuttx/spi.h                      OK,BSD, only small change made
76 1 gnutoo
 nuttx/include/sercomm/msgb.h                   
77
 nuttx/include/sercomm/sercomm.h                
78
 nuttx/include/sercomm/sercomm_cons.h           
79
 70 files changed, 9221 insertions(+), 3 deletions(-)
80
}}}
81
82
We can safely assume that the config dir weren't took from osmocom-bb.
83
84
== init.c and calypso_heap.c ==
85
=== nuttx-bb ===
86
 * Copyright Stefan Richter
87
 * BSD license
88
 * nuttx/arch/arm/src/calypso/calypso_heap.c
89
{{{
90
void up_addregion(void)
91
{
92
#ifdef CONFIG_ARCH_BOARD_COMPALE99
93
        /* Disable watchdog in first non-common function */
94
        wdog_enable(0);
95
#endif
96
        // XXX: change to initialization of extern memory with save defaults
97
        /* Configure memory interface */
98
        calypso_mem_cfg(CALYPSO_nCS0, 3, CALYPSO_MEM_16bit, 1);
99
        calypso_mem_cfg(CALYPSO_nCS1, 3, CALYPSO_MEM_16bit, 1);
100
        calypso_mem_cfg(CALYPSO_nCS2, 5, CALYPSO_MEM_16bit, 1);
101
        calypso_mem_cfg(CALYPSO_nCS3, 5, CALYPSO_MEM_16bit, 1);
102
        calypso_mem_cfg(CALYPSO_CS4, 0, CALYPSO_MEM_8bit, 1);
103
        calypso_mem_cfg(CALYPSO_nCS6, 0, CALYPSO_MEM_32bit, 1);
104
        calypso_mem_cfg(CALYPSO_nCS7, 0, CALYPSO_MEM_32bit, 0);
105
106
        /* Set VTCXO_DIV2 = 1, configure PLL for 104 MHz and give ARM half of that */
107
        calypso_clock_set(2, CALYPSO_PLL13_104_MHZ, ARM_MCLK_DIV_2);
108
109
        /* Configure the RHEA bridge with some sane default values */
110
        calypso_rhea_cfg(0, 0, 0xff, 0, 1, 0, 0);
111
}
112
113
}}}
114
 * GPL
115
 * Copyright Harald Welte and Steve Markgraf
116
 * src/target/firmware/board/compal_e99/init.c
117
{{{
118
void board_init(void)
119
{
120
        /* Disable watchdog (compal loader leaves it enabled) */
121
        wdog_enable(0);
122
123
        /* Configure memory interface */
124
        calypso_mem_cfg(CALYPSO_nCS0, 3, CALYPSO_MEM_16bit, 1);
125
        calypso_mem_cfg(CALYPSO_nCS1, 3, CALYPSO_MEM_16bit, 1);
126
        calypso_mem_cfg(CALYPSO_nCS2, 5, CALYPSO_MEM_16bit, 1);
127
        calypso_mem_cfg(CALYPSO_nCS3, 5, CALYPSO_MEM_16bit, 1);
128
        calypso_mem_cfg(CALYPSO_CS4, 0, CALYPSO_MEM_8bit, 1);
129
        calypso_mem_cfg(CALYPSO_nCS6, 0, CALYPSO_MEM_32bit, 1);
130
        calypso_mem_cfg(CALYPSO_nCS7, 0, CALYPSO_MEM_32bit, 0);
131
132
        /* Set VTCXO_DIV2 = 1, configure PLL for 104 MHz and give ARM half of that */
133
        calypso_clock_set(2, CALYPSO_PLL13_104_MHZ, ARM_MCLK_DIV_2);
134
135
        /* Configure the RHEA bridge with some sane default values */
136
        calypso_rhea_cfg(0, 0, 0xff, 0, 1, 0, 0);
137
138
}}}
Add picture from clipboard (Maximum size: 48.8 MB)