Date:2010-12-18 03:01:31 (8 years 6 months ago)
Author:Werner Almesberger
Commit:ad2c72fa7f4f373716016dd0777f44b85c365209
Message:atusb: firmware update for the 2010-12-16 board series

- fw/Makefile: replaced "make" with $(MAKE) (just for style)
- common/Makefile.common: Makefile settings shared within project. For now,
this contains only the board version, which defaults to 2010-12-16.
- fw/common/Makefile, fw/boot/Makefile, fw/atusb/Makefile: include
common/Makefile.common
- fw/common/Makefile, fw/boot/Makefile, fw/atusb/Makefile: pass board
version to cpp and gcc
- fw/atusb/atusb.c (init_io): individually set IRQ_RF to one, LED and TST
to zero
- fw/atusb/atusb.c (init_io): added macros to set all unused pins to zero
in a way that doesn't need updating if a signal moves from one pin to
another
- include/atusb/ep0.h: added hardware type 1 (2010-12-16 design)
- common/config.h: set hardware type depending on board version
- common/io.h: assign pins depending on board version
Files: atusb/fw/Makefile (2 diffs)
atusb/fw/atusb/Makefile (1 diff)
atusb/fw/atusb/atusb.c (2 diffs)
atusb/fw/boot/Makefile (1 diff)
atusb/fw/common/Makefile (2 diffs)
atusb/fw/common/Makefile.common (1 diff)
atusb/fw/common/config.h (1 diff)
atusb/fw/common/io.h (2 diffs)
atusb/fw/include/atusb/ep0.h (1 diff)

Change Details

atusb/fw/Makefile
1717.PHONY: all depend install uninstall clean spotless
1818
1919all:
20        for d in $(DIRS); do make -C $$d all || exit 1; done
20        for d in $(DIRS); do $(MAKE) -C $$d all || exit 1; done
2121
2222depend:
23        for d in $(DIRS); do make -C $$d depend || exit 1; done
23        for d in $(DIRS); do $(MAKE) -C $$d depend || exit 1; done
2424
2525# Top-level Makefile recurses for "install" and "uninstall", which have no use
2626# here. Just ignore them.
...... 
3030uninstall:
3131
3232clean:
33        for d in $(DIRS); do make -C $$d clean || exit 1; done
33        for d in $(DIRS); do $(MAKE) -C $$d clean || exit 1; done
3434
3535spotless:
36        for d in $(DIRS); do make -C $$d spotless || exit 1; done
36        for d in $(DIRS); do $(MAKE) -C $$d spotless || exit 1; done
atusb/fw/atusb/Makefile
1818
1919include $(F32XBASE)/fw/common/Makefile.system
2020include $(F32XBASE)/fw/common/Makefile.common
21include ../common/Makefile.common
2122
22CFLAGS += -I../common -I../include
23CFLAGS += -I../common -I../include -D$(BOARD)
2324LDFLAGS += --code-size $(PAYLOAD_SIZE) --code-loc $(PAYLOAD_START)
2425
2526USB_ID = $(shell \
atusb/fw/atusb/atusb.c
5959}
6060
6161
62/*
63 * The following macros set all unused pins on a given port to zero. This is
64 * more elaborate than just setting the ports directly, but it has the
65 * advantage of hiding the pin to port relation.
66 */
67
68#define PORT_NUM_P0 0
69#define PORT_NUM_P2 2
70#define PORT_NUM_P3 3
71
72#define __PORT_NUM(mode) PORT_NUM_##mode
73#define PORT_NUM(mode) __PORT_NUM(mode)
74
75#define USED(port, net) (PORT_NUM(net##_PORT) == port ? 1 << net##_BIT : 0)
76
77#define ZERO_UNUSED(port) \
78    P##port &= \
79        USED(port, LED) | \
80        USED(port, ID) | \
81        USED(port, MOSI) | \
82        USED(port, MISO) | \
83        USED(port, SCLK) | \
84        USED(port, nSS) | \
85        USED(port, nRST_RF) | \
86        USED(port, IRQ_RF) | \
87        USED(port, SLP_TR) | \
88        USED(port, TST)
89
90
6291static void init_io(void)
6392{
6493    /*
...... 
91120    SLP_TR = 0;
92121    SLP_TR_MODE |= 1 << SLP_TR_BIT;
93122
94    P0 = 1; /* IRQ_RF = 1; LED = 0; TST = Z; the rest is unused */
95    P3 = 0;
123    IRQ_RF = 1;
124    LED = 0;
125    TST = 0;
126
127    ZERO_UNUSED(0);
128    ZERO_UNUSED(2);
129    ZERO_UNUSED(3);
96130
97131#if 0
98132    /*
atusb/fw/boot/Makefile
1717
1818include $(F32XBASE)/fw/common/Makefile.system
1919include $(F32XBASE)/fw/common/Makefile.common
20include ../common/Makefile.common
2021
21CFLAGS += -I../common -I../include
22CFLAGS += -I../common -I../include -D$(BOARD)
2223LDFLAGS += --code-size $(PAYLOAD_START)
atusb/fw/common/Makefile
1010# (at your option) any later version.
1111#
1212
13include Makefile.common
14
1315
1416GEN_quiet = @echo " GENERATE " $@ &&
1517
...... 
2527all: io-parts.h
2628
2729io-parts.h: io.h Makefile
28        $(GEN) $(CPP) -dD $< | \
30        $(GEN) $(CPP) -D$(BOARD) -dD $< | \
2931          sed '1,/IO_H/d' | \
3032          awk \
3133          'BEGIN { print "/* MACHINE-GENERATED. DO NOT EDIT ! */"; \
atusb/fw/common/Makefile.common
1#
2# common/Makefile.common - Makefile settings shared within project
3#
4# Written 2010 by Werner Almesberger
5# Copyright 2010 Werner Almesberger
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12
13#BOARD=BOARD_100813
14BOARD=BOARD_101216
atusb/fw/common/config.h
3939
4040/* ----- Application configuration ----------------------------------------- */
4141
42#if defined(BOARD_1008xx)
4243#define HW_TYPE HW_TYPE_100813
44#elif defined(BOARD_1012xx)
45#define HW_TYPE HW_TYPE_101216
46#else
47#error must define BOARD_1008xx or BOARD_1012xx
48#endif
4349
4450#endif /* !CONFIG_H */
atusb/fw/common/io.h
1818
1919#define LED P0_1
2020
21/* ID pin */
22
23/*
24 * 100813 open
25 * 101216 GND
26 */
27
28#define ID P0_2
29
30#if defined(BOARD_100813)
31
2132/* SPI */
2233
2334#define MOSI P2_2
...... 
3243#define SLP_TR P2_1
3344#define TST P0_7
3445
46#elif defined(BOARD_101216)
47
48/* SPI */
49
50#define MOSI P2_1
51#define MISO P2_0
52#define SCLK P0_7
53#define nSS P2_4
54
55/* Miscellaneous RF signals */
56
57#define nRST_RF P0_6
58#define IRQ_RF P0_0
59#define SLP_TR P0_5
60#define TST P0_4
61
62#else
63#error must define BOARD_1008xx or BOARD1012xx
64#endif /* !BOARD_101216 */
65
3566#endif /* !IO_H */
atusb/fw/include/atusb/ep0.h
4343#define EP0ATUSB_MAJOR 0 /* EP0 protocol, major revision */
4444#define EP0ATUSB_MINOR 1 /* EP0 protocol, minor revision */
4545
46#define HW_TYPE_100813 0 /* 100813 */
46#define HW_TYPE_100813 0 /* 2010-08-13 */
47#define HW_TYPE_101216 1 /* 2010-12-16 */
4748
4849
4950/*

Archive Download the corresponding diff file



interactive