Project

General

Profile

Code-audit » History » Version 33

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
108
109
== calypsotest/main.c ==
110
=== nuttx-bb ===
111
 * Copyright Harald Welte and Steve Markgraf
112
 * BSD License
113
 * apps/examples/calypsotest/main.c
114
 * Copied from OsmocomBB: src/target/firmware/board/compal_e99/init.c
115
116
117 1 gnutoo
== init.c and calypso_heap.c ==
118
=== nuttx-bb ===
119
 * Copyright Stefan Richter
120 10 gnutoo
 * BSD License
121 1 gnutoo
 * nuttx/arch/arm/src/calypso/calypso_heap.c
122
{{{
123
void up_addregion(void)
124
{
125
#ifdef CONFIG_ARCH_BOARD_COMPALE99
126
        /* Disable watchdog in first non-common function */
127
        wdog_enable(0);
128
#endif
129
        // XXX: change to initialization of extern memory with save defaults
130
        /* Configure memory interface */
131
        calypso_mem_cfg(CALYPSO_nCS0, 3, CALYPSO_MEM_16bit, 1);
132
        calypso_mem_cfg(CALYPSO_nCS1, 3, CALYPSO_MEM_16bit, 1);
133
        calypso_mem_cfg(CALYPSO_nCS2, 5, CALYPSO_MEM_16bit, 1);
134
        calypso_mem_cfg(CALYPSO_nCS3, 5, CALYPSO_MEM_16bit, 1);
135
        calypso_mem_cfg(CALYPSO_CS4, 0, CALYPSO_MEM_8bit, 1);
136
        calypso_mem_cfg(CALYPSO_nCS6, 0, CALYPSO_MEM_32bit, 1);
137
        calypso_mem_cfg(CALYPSO_nCS7, 0, CALYPSO_MEM_32bit, 0);
138
139
        /* Set VTCXO_DIV2 = 1, configure PLL for 104 MHz and give ARM half of that */
140
        calypso_clock_set(2, CALYPSO_PLL13_104_MHZ, ARM_MCLK_DIV_2);
141
142
        /* Configure the RHEA bridge with some sane default values */
143
        calypso_rhea_cfg(0, 0, 0xff, 0, 1, 0, 0);
144
}
145
146
}}}
147 10 gnutoo
=== Osmocom-bb ===
148 1 gnutoo
 * GPL
149
 * Copyright Harald Welte and Steve Markgraf
150
 * src/target/firmware/board/compal_e99/init.c
151
{{{
152
void board_init(void)
153
{
154
        /* Disable watchdog (compal loader leaves it enabled) */
155
        wdog_enable(0);
156
157
        /* Configure memory interface */
158
        calypso_mem_cfg(CALYPSO_nCS0, 3, CALYPSO_MEM_16bit, 1);
159
        calypso_mem_cfg(CALYPSO_nCS1, 3, CALYPSO_MEM_16bit, 1);
160
        calypso_mem_cfg(CALYPSO_nCS2, 5, CALYPSO_MEM_16bit, 1);
161
        calypso_mem_cfg(CALYPSO_nCS3, 5, CALYPSO_MEM_16bit, 1);
162
        calypso_mem_cfg(CALYPSO_CS4, 0, CALYPSO_MEM_8bit, 1);
163
        calypso_mem_cfg(CALYPSO_nCS6, 0, CALYPSO_MEM_32bit, 1);
164
        calypso_mem_cfg(CALYPSO_nCS7, 0, CALYPSO_MEM_32bit, 0);
165
166
        /* Set VTCXO_DIV2 = 1, configure PLL for 104 MHz and give ARM half of that */
167
        calypso_clock_set(2, CALYPSO_PLL13_104_MHZ, ARM_MCLK_DIV_2);
168
169
        /* Configure the RHEA bridge with some sane default values */
170
        calypso_rhea_cfg(0, 0, 0xff, 0, 1, 0, 0);
171
172
}}}
Add picture from clipboard (Maximum size: 48.8 MB)