Project

General

Profile

Code-audit » History » Version 38

acassis, 02/19/2016 10:49 PM

1 1 gnutoo
== Introduction ==
2 31 gnutoo
This page is a code audit that:
3
 * Verify if the license are correct(not copied from osmocom-bb and changed from GPL to BSD)
4
 * permit to view the license of each file, that's important for the inclusion into the official nuttx that only accepts BSD code for the non-applications part.
5 1 gnutoo
== Audit ==
6
Currently the following files were added or modified by nuttx-bb(on top of nuttx):
7
{{{
8
 apps/examples/calypsotest/Makefile             
9
 apps/examples/calypsotest/bounce_analyze.c     
10
 apps/examples/calypsotest/main.c               
11
 apps/examples/ostest/main.c                    
12 22 gnutoo
 nuttx/arch/arm/include/calypso/armio.h         OK,BSD only definitions of functions
13 30 gnutoo
 nuttx/arch/arm/include/calypso/clock.h         no license, copied from omsocombb's src/target/firmware/include/clock.h(which has no license too)
14 26 gnutoo
 nuttx/arch/arm/include/calypso/debug.h         no license, copied from omsocombb's src/target/firmware/include/debug.h(which has no license too), debug macros
15
 nuttx/arch/arm/include/calypso/defines.h       no license, copied from osmocombb's src/target/firmware/include/defines.h(which has no license too), trivial defines like #define __unused attribute__((unused))
16 24 gnutoo
 nuttx/arch/arm/include/calypso/irq.h           GPL, copyright Harald Welte and Stefan Richter
17 26 gnutoo
 nuttx/arch/arm/include/calypso/memory.h        no license,copied from osmocombb's src/target/firmware/include/memory.h(which has no license too),  trivial defines like #define readb(a) __arch_getb(a)
18
 nuttx/arch/arm/include/calypso/timer.h         no license, copied from osmocombb's src/target/firmware/include/timer.h(which has no license too), only definitions of functions
19 19 gnutoo
 nuttx/arch/arm/src/Makefile                    OK,BSD
20
 nuttx/arch/arm/src/calypso/Make.defs           OK,BSD
21 17 gnutoo
 nuttx/arch/arm/src/calypso/calypso_armio.c     BSD,copyright Stefan Richter, seem ok(grep found nothing in osmocom-bb)
22 29 gnutoo
 nuttx/arch/arm/src/calypso/calypso_head.S      no license, specific to nuttx( it jumps to functions like up_ which are nuttx functions)
23 17 gnutoo
 nuttx/arch/arm/src/calypso/calypso_heap.c      problematic?, see below
24 32 gnutoo
 nuttx/arch/arm/src/calypso/calypso_irq.c       OK,GPL, copied from osmocombb's src/target/firmware/calypso/irq.c , copyright Harald Welte and Stefan Richter
25 13 gnutoo
 nuttx/arch/arm/src/calypso/calypso_keypad.c    OK,BSD, totally different from osmocom-bb's src/target/firmware/calypso/keypad.c 
26 15 gnutoo
 nuttx/arch/arm/src/calypso/calypso_lowputc.S   OK,BSD, not found in osmocom-bb source
27 18 gnutoo
 nuttx/arch/arm/src/calypso/calypso_serial.c    OK,BSD, based on nuttx/arch/arm/src/c5471/c5471_serial.c from nuttx (verified with diff)
28 1 gnutoo
 nuttx/arch/arm/src/calypso/calypso_spi.c       OK,BSD, wrapper arround osmocombb's SPI, incomplete
29 14 gnutoo
 nuttx/arch/arm/src/calypso/calypso_timer.c     OK,GPL, copyright Harald Welte and Stefan Richter
30 21 gnutoo
 nuttx/arch/arm/src/calypso/chip.h              OK,BSD,based on nuttx/arch/arm/src/c5471/chip.h
31 14 gnutoo
 nuttx/arch/arm/src/calypso/clock.c             OK,GPL, copyright Harald Welte
32 20 gnutoo
 nuttx/arch/arm/src/common/up_internal.h        OK,BSD,trivial modification(part of nuttx)
33 3 gnutoo
 nuttx/configs/compal_e88/calypsotest/Make.defs OK,BSD
34
 nuttx/configs/compal_e88/calypsotest/appconfig OK,BSD
35
 nuttx/configs/compal_e88/calypsotest/defconfig OK,BSD
36
 nuttx/configs/compal_e88/calypsotest/setenv.sh OK,BSD
37
 nuttx/configs/compal_e88/include/board.h       OK,BSD
38
 nuttx/configs/compal_e88/ld.script             OK,BSD
39
 nuttx/configs/compal_e88/nsh/Make.defs         OK,BSD
40
 nuttx/configs/compal_e88/nsh/appconfig         OK,BSD
41
 nuttx/configs/compal_e88/nsh/defconfig         OK,BSD
42
 nuttx/configs/compal_e88/nsh/ld.script         OK,BSD
43
 nuttx/configs/compal_e88/nsh/setenv.sh         OK,BSD
44
 nuttx/configs/compal_e88/ostest/Make.defs      OK,BSD
45
 nuttx/configs/compal_e88/ostest/appconfig      OK,BSD
46
 nuttx/configs/compal_e88/ostest/defconfig      OK,BSD
47
 nuttx/configs/compal_e88/ostest/setenv.sh      OK,BSD
48
 nuttx/configs/compal_e88/src/Make.dep          OK,BSD
49
 nuttx/configs/compal_e88/src/Makefile          OK,BSD
50
 nuttx/configs/compal_e88/src/dummy.c           OK,BSD
51
 nuttx/configs/compal_e99/calypsotest/Make.defs OK,BSD
52
 nuttx/configs/compal_e99/calypsotest/appconfig OK,BSD
53
 nuttx/configs/compal_e99/calypsotest/defconfig OK,BSD
54
 nuttx/configs/compal_e99/calypsotest/setenv.sh OK,BSD
55
 nuttx/configs/compal_e99/include/board.h       OK,BSD
56
 nuttx/configs/compal_e99/ld.script             OK,BSD
57
 nuttx/configs/compal_e99/nsh/Make.defs         OK,BSD
58
 nuttx/configs/compal_e99/nsh/appconfig         OK,BSD
59
 nuttx/configs/compal_e99/nsh/defconfig         OK,BSD
60
 nuttx/configs/compal_e99/nsh/ld.script         OK,BSD
61
 nuttx/configs/compal_e99/nsh/setenv.sh         OK,BSD
62
 nuttx/configs/compal_e99/ostest/Make.defs      OK,BSD
63
 nuttx/configs/compal_e99/ostest/appconfig      OK,BSD
64
 nuttx/configs/compal_e99/ostest/defconfig      OK,BSD
65
 nuttx/configs/compal_e99/ostest/setenv.sh      OK,BSD
66
 nuttx/configs/compal_e99/src/Makefile          OK,BSD
67
 nuttx/configs/compal_e99/src/dummy.c           OK,BSD
68 9 gnutoo
 nuttx/drivers/Makefile                         OK,BSD
69
 nuttx/drivers/sercomm/Make.defs                OK,BSD
70 12 gnutoo
 nuttx/drivers/sercomm/console.c                mostly OK(see below), BSD
71 5 gnutoo
 nuttx/drivers/sercomm/loadwriter.py            no copyright at all, small enough
72 4 gnutoo
 nuttx/drivers/sercomm/uart.c                   OK,GPL, copyright Harald Welte and Ingo Albrecht
73 28 gnutoo
 nuttx/drivers/sercomm/uart.h                   no license, copied from osmocom-bb's src/target/firmware/include/uart.h which had no license too
74 5 gnutoo
 nuttx/include/nuttx/spi.h                      OK,BSD, only small change made
75 8 gnutoo
 nuttx/include/sercomm/msgb.h                   OK,GPL,copyright Harald Welte
76
 nuttx/include/sercomm/sercomm.h                copy of src/target/firmware/include/comm/sercomm.h, no license in both.
77 27 gnutoo
 nuttx/include/sercomm/sercomm_cons.h           no license,copied from osmocom-bb's src/target/firmware/include/comm/sercomm_cons.h which had no license, interface only(only 2 definitions of functions inside)
78 1 gnutoo
 70 files changed, 9221 insertions(+), 3 deletions(-)
79
}}}
80
81
We can safely assume that the config dir weren't took from osmocom-bb.
82 10 gnutoo
== init.c and console.c ==
83
=== nuttx-bb ===
84
 * Copyright Stefan Richter
85
 * BSD License
86
 * nuttx/drivers/sercomm/console.c
87
{{{
88
        /* XXX: initialize MODEMUART to be used for sercomm*/
89
        uart_init(SERCOMM_UART_NR, 1);
90
        uart_baudrate(SERCOMM_UART_NR, UART_115200);
91
}}}
92 11 gnutoo
=== osmocom-bb ===
93 10 gnutoo
 * GPL
94
 * Copyright Harald Welte and Steve Markgraf
95
 * src/target/firmware/board/compal_e99/init.c
96
{{{
97
        /* initialize MODEM UART to be used for sercomm*/
98
        uart_init(SERCOMM_UART_NR, 1);
99
        uart_baudrate(SERCOMM_UART_NR, UART_115200);
100
}}}
101 33 acassis
102
== calypsotest/bounce_analyze.c ==
103
=== nuttx-bb ===
104
 * Copyright Stefan Richter
105
 * GPL License (could keep as GPL since it is an application)
106
 * apps/examples/calypsotest/bounce_analyze.c
107 34 acassis
=== osmocom-bb ===
108 35 acassis
 * nothing found
109 33 acassis
110
111
== calypsotest/main.c ==
112 1 gnutoo
=== nuttx-bb ===
113 34 acassis
 * Copyright Stefan Richter
114 1 gnutoo
 * BSD License
115
 * apps/examples/calypsotest/main.c
116 34 acassis
117
=== osmocom-bb ===
118
 * Copyright Harald Welte and Steve Markgraf
119
 * GPL License
120
 * src/target/firmware/board/compal_e99/init.c
121 1 gnutoo
122 35 acassis
== ostest/main.c ==
123
=== nuttx-bb ===
124
 * Copyright Gregory Nutt
125
 * BSD License
126
 * apps/examples/ostest/main.c
127 36 acassis
 * Note: lights_on function used snippet code of OsmocomBB src/target/firmware/board/compal_e99/init.c
128 35 acassis
=== osmocom-bb ===
129
 * nothing found
130 33 acassis
131 37 acassis
== calypso/calypso_armio.c ==
132
=== nuttx-bb ===
133
 * Copyright Stefan Richter
134
 * BSD License
135
 * nuttx/arch/arm/src/calypso/calypso_armio.c
136
=== osmocom-bb ===
137
 * nothing found
138
139 38 acassis
== calypso/calypso_head.S ==
140
=== nuttx-bb ===
141
 * No copyright
142
 * No License
143
 * nuttx/arch/arm/src/calypso/calypso_head.S
144
 * Note: this is same file as nuttx/arch/arm/src/chip/calypso_head.S
145
=== osmocom-bb ===
146
 * nothing found
147
148 1 gnutoo
== init.c and calypso_heap.c ==
149
=== nuttx-bb ===
150
 * Copyright Stefan Richter
151 10 gnutoo
 * BSD License
152 1 gnutoo
 * nuttx/arch/arm/src/calypso/calypso_heap.c
153
{{{
154
void up_addregion(void)
155
{
156
#ifdef CONFIG_ARCH_BOARD_COMPALE99
157
        /* Disable watchdog in first non-common function */
158
        wdog_enable(0);
159
#endif
160
        // XXX: change to initialization of extern memory with save defaults
161
        /* Configure memory interface */
162
        calypso_mem_cfg(CALYPSO_nCS0, 3, CALYPSO_MEM_16bit, 1);
163
        calypso_mem_cfg(CALYPSO_nCS1, 3, CALYPSO_MEM_16bit, 1);
164
        calypso_mem_cfg(CALYPSO_nCS2, 5, CALYPSO_MEM_16bit, 1);
165
        calypso_mem_cfg(CALYPSO_nCS3, 5, CALYPSO_MEM_16bit, 1);
166
        calypso_mem_cfg(CALYPSO_CS4, 0, CALYPSO_MEM_8bit, 1);
167
        calypso_mem_cfg(CALYPSO_nCS6, 0, CALYPSO_MEM_32bit, 1);
168
        calypso_mem_cfg(CALYPSO_nCS7, 0, CALYPSO_MEM_32bit, 0);
169
170
        /* Set VTCXO_DIV2 = 1, configure PLL for 104 MHz and give ARM half of that */
171
        calypso_clock_set(2, CALYPSO_PLL13_104_MHZ, ARM_MCLK_DIV_2);
172
173
        /* Configure the RHEA bridge with some sane default values */
174
        calypso_rhea_cfg(0, 0, 0xff, 0, 1, 0, 0);
175
}
176
177
}}}
178 10 gnutoo
=== Osmocom-bb ===
179 1 gnutoo
 * GPL
180
 * Copyright Harald Welte and Steve Markgraf
181
 * src/target/firmware/board/compal_e99/init.c
182
{{{
183
void board_init(void)
184
{
185
        /* Disable watchdog (compal loader leaves it enabled) */
186
        wdog_enable(0);
187
188
        /* Configure memory interface */
189
        calypso_mem_cfg(CALYPSO_nCS0, 3, CALYPSO_MEM_16bit, 1);
190
        calypso_mem_cfg(CALYPSO_nCS1, 3, CALYPSO_MEM_16bit, 1);
191
        calypso_mem_cfg(CALYPSO_nCS2, 5, CALYPSO_MEM_16bit, 1);
192
        calypso_mem_cfg(CALYPSO_nCS3, 5, CALYPSO_MEM_16bit, 1);
193
        calypso_mem_cfg(CALYPSO_CS4, 0, CALYPSO_MEM_8bit, 1);
194
        calypso_mem_cfg(CALYPSO_nCS6, 0, CALYPSO_MEM_32bit, 1);
195
        calypso_mem_cfg(CALYPSO_nCS7, 0, CALYPSO_MEM_32bit, 0);
196
197
        /* Set VTCXO_DIV2 = 1, configure PLL for 104 MHz and give ARM half of that */
198
        calypso_clock_set(2, CALYPSO_PLL13_104_MHZ, ARM_MCLK_DIV_2);
199
200
        /* Configure the RHEA bridge with some sane default values */
201
        calypso_rhea_cfg(0, 0, 0xff, 0, 1, 0, 0);
202
203
}}}
Add picture from clipboard (Maximum size: 48.8 MB)