Project

General

Profile

Code-audit » History » Version 32

gnutoo, 02/19/2016 10:49 PM
nuttx audit: add a nuttx file provenance,thanks Alan Carvalho de Assis for the info

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