Project

General

Profile

Code-audit » History » Version 13

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 13 gnutoo
 nuttx/arch/arm/src/calypso/calypso_keypad.c    OK,BSD, totally different from osmocom-bb's src/target/firmware/calypso/keypad.c 
27
28 1 gnutoo
 nuttx/arch/arm/src/calypso/calypso_lowputc.S   
29
 nuttx/arch/arm/src/calypso/calypso_serial.c    
30 6 gnutoo
 nuttx/arch/arm/src/calypso/calypso_spi.c       OK,BSD, wrapper arround osmocombb's SPI, incomplete
31 1 gnutoo
 nuttx/arch/arm/src/calypso/calypso_timer.c     
32
 nuttx/arch/arm/src/calypso/chip.h              
33
 nuttx/arch/arm/src/calypso/clock.c             
34
 nuttx/arch/arm/src/common/up_internal.h        
35 3 gnutoo
 nuttx/configs/compal_e88/calypsotest/Make.defs OK,BSD
36
 nuttx/configs/compal_e88/calypsotest/appconfig OK,BSD
37
 nuttx/configs/compal_e88/calypsotest/defconfig OK,BSD
38
 nuttx/configs/compal_e88/calypsotest/setenv.sh OK,BSD
39
 nuttx/configs/compal_e88/include/board.h       OK,BSD
40
 nuttx/configs/compal_e88/ld.script             OK,BSD
41
 nuttx/configs/compal_e88/nsh/Make.defs         OK,BSD
42
 nuttx/configs/compal_e88/nsh/appconfig         OK,BSD
43
 nuttx/configs/compal_e88/nsh/defconfig         OK,BSD
44
 nuttx/configs/compal_e88/nsh/ld.script         OK,BSD
45
 nuttx/configs/compal_e88/nsh/setenv.sh         OK,BSD
46
 nuttx/configs/compal_e88/ostest/Make.defs      OK,BSD
47
 nuttx/configs/compal_e88/ostest/appconfig      OK,BSD
48
 nuttx/configs/compal_e88/ostest/defconfig      OK,BSD
49
 nuttx/configs/compal_e88/ostest/setenv.sh      OK,BSD
50
 nuttx/configs/compal_e88/src/Make.dep          OK,BSD
51
 nuttx/configs/compal_e88/src/Makefile          OK,BSD
52
 nuttx/configs/compal_e88/src/dummy.c           OK,BSD
53
 nuttx/configs/compal_e99/calypsotest/Make.defs OK,BSD
54
 nuttx/configs/compal_e99/calypsotest/appconfig OK,BSD
55
 nuttx/configs/compal_e99/calypsotest/defconfig OK,BSD
56
 nuttx/configs/compal_e99/calypsotest/setenv.sh OK,BSD
57
 nuttx/configs/compal_e99/include/board.h       OK,BSD
58
 nuttx/configs/compal_e99/ld.script             OK,BSD
59
 nuttx/configs/compal_e99/nsh/Make.defs         OK,BSD
60
 nuttx/configs/compal_e99/nsh/appconfig         OK,BSD
61
 nuttx/configs/compal_e99/nsh/defconfig         OK,BSD
62
 nuttx/configs/compal_e99/nsh/ld.script         OK,BSD
63
 nuttx/configs/compal_e99/nsh/setenv.sh         OK,BSD
64
 nuttx/configs/compal_e99/ostest/Make.defs      OK,BSD
65
 nuttx/configs/compal_e99/ostest/appconfig      OK,BSD
66
 nuttx/configs/compal_e99/ostest/defconfig      OK,BSD
67
 nuttx/configs/compal_e99/ostest/setenv.sh      OK,BSD
68
 nuttx/configs/compal_e99/src/Makefile          OK,BSD
69
 nuttx/configs/compal_e99/src/dummy.c           OK,BSD
70 9 gnutoo
 nuttx/drivers/Makefile                         OK,BSD
71
 nuttx/drivers/sercomm/Make.defs                OK,BSD
72 12 gnutoo
 nuttx/drivers/sercomm/console.c                mostly OK(see below), BSD
73 5 gnutoo
 nuttx/drivers/sercomm/loadwriter.py            no copyright at all, small enough
74 4 gnutoo
 nuttx/drivers/sercomm/uart.c                   OK,GPL, copyright Harald Welte and Ingo Albrecht
75
 nuttx/drivers/sercomm/uart.h                   no copyright at all
76 5 gnutoo
 nuttx/include/nuttx/spi.h                      OK,BSD, only small change made
77 8 gnutoo
 nuttx/include/sercomm/msgb.h                   OK,GPL,copyright Harald Welte
78
 nuttx/include/sercomm/sercomm.h                copy of src/target/firmware/include/comm/sercomm.h, no license in both.
79 7 gnutoo
 nuttx/include/sercomm/sercomm_cons.h           no license,interface only(only 2 definitions of functions inside)
80 1 gnutoo
 70 files changed, 9221 insertions(+), 3 deletions(-)
81
}}}
82
83
We can safely assume that the config dir weren't took from osmocom-bb.
84 10 gnutoo
== init.c and console.c ==
85
=== nuttx-bb ===
86
 * Copyright Stefan Richter
87
 * BSD License
88
 * nuttx/drivers/sercomm/console.c
89
{{{
90
        /* XXX: initialize MODEMUART to be used for sercomm*/
91
        uart_init(SERCOMM_UART_NR, 1);
92
        uart_baudrate(SERCOMM_UART_NR, UART_115200);
93
}}}
94 11 gnutoo
=== osmocom-bb ===
95 10 gnutoo
 * GPL
96
 * Copyright Harald Welte and Steve Markgraf
97
 * src/target/firmware/board/compal_e99/init.c
98
{{{
99
        /* initialize MODEM UART to be used for sercomm*/
100
        uart_init(SERCOMM_UART_NR, 1);
101
        uart_baudrate(SERCOMM_UART_NR, UART_115200);
102
}}}
103 1 gnutoo
== init.c and calypso_heap.c ==
104
=== nuttx-bb ===
105
 * Copyright Stefan Richter
106 10 gnutoo
 * BSD License
107 1 gnutoo
 * nuttx/arch/arm/src/calypso/calypso_heap.c
108
{{{
109
void up_addregion(void)
110
{
111
#ifdef CONFIG_ARCH_BOARD_COMPALE99
112
        /* Disable watchdog in first non-common function */
113
        wdog_enable(0);
114
#endif
115
        // XXX: change to initialization of extern memory with save defaults
116
        /* Configure memory interface */
117
        calypso_mem_cfg(CALYPSO_nCS0, 3, CALYPSO_MEM_16bit, 1);
118
        calypso_mem_cfg(CALYPSO_nCS1, 3, CALYPSO_MEM_16bit, 1);
119
        calypso_mem_cfg(CALYPSO_nCS2, 5, CALYPSO_MEM_16bit, 1);
120
        calypso_mem_cfg(CALYPSO_nCS3, 5, CALYPSO_MEM_16bit, 1);
121
        calypso_mem_cfg(CALYPSO_CS4, 0, CALYPSO_MEM_8bit, 1);
122
        calypso_mem_cfg(CALYPSO_nCS6, 0, CALYPSO_MEM_32bit, 1);
123
        calypso_mem_cfg(CALYPSO_nCS7, 0, CALYPSO_MEM_32bit, 0);
124
125
        /* Set VTCXO_DIV2 = 1, configure PLL for 104 MHz and give ARM half of that */
126
        calypso_clock_set(2, CALYPSO_PLL13_104_MHZ, ARM_MCLK_DIV_2);
127
128
        /* Configure the RHEA bridge with some sane default values */
129
        calypso_rhea_cfg(0, 0, 0xff, 0, 1, 0, 0);
130
}
131
132
}}}
133 10 gnutoo
=== Osmocom-bb ===
134 1 gnutoo
 * GPL
135
 * Copyright Harald Welte and Steve Markgraf
136
 * src/target/firmware/board/compal_e99/init.c
137
{{{
138
void board_init(void)
139
{
140
        /* Disable watchdog (compal loader leaves it enabled) */
141
        wdog_enable(0);
142
143
        /* Configure memory interface */
144
        calypso_mem_cfg(CALYPSO_nCS0, 3, CALYPSO_MEM_16bit, 1);
145
        calypso_mem_cfg(CALYPSO_nCS1, 3, CALYPSO_MEM_16bit, 1);
146
        calypso_mem_cfg(CALYPSO_nCS2, 5, CALYPSO_MEM_16bit, 1);
147
        calypso_mem_cfg(CALYPSO_nCS3, 5, CALYPSO_MEM_16bit, 1);
148
        calypso_mem_cfg(CALYPSO_CS4, 0, CALYPSO_MEM_8bit, 1);
149
        calypso_mem_cfg(CALYPSO_nCS6, 0, CALYPSO_MEM_32bit, 1);
150
        calypso_mem_cfg(CALYPSO_nCS7, 0, CALYPSO_MEM_32bit, 0);
151
152
        /* Set VTCXO_DIV2 = 1, configure PLL for 104 MHz and give ARM half of that */
153
        calypso_clock_set(2, CALYPSO_PLL13_104_MHZ, ARM_MCLK_DIV_2);
154
155
        /* Configure the RHEA bridge with some sane default values */
156
        calypso_rhea_cfg(0, 0, 0xff, 0, 1, 0, 0);
157
158
}}}
Add picture from clipboard (Maximum size: 48.8 MB)