1 /*********************************************************************
2  *
3  *   LPC Parts identification
4  *
5  *
6  * Written by Nathael Pajani <nathael.pajani@nathael.net>
7  *
8  * This programm is released under the terms of the GNU GPLv3 licence
9  * as can be found on the GNU website : <http://www.gnu.org/licenses/>
10  *
11  *********************************************************************/
13 #include <stdint.h> /* uint64_t */
14 #include <stdlib.h> /* NULL */
15 #include "parts.h"
17 struct part_desc parts[] = {
18         /*        part info             |        flash             | reset  |            ram                  */
19         /*                              |                      nb  | vector |                      buffer     */
20         /*  part_id      part name      | base addr    size   sect | offset | base addr   size    off   size  */
21         { 0x2540102B, "LPC1114FHN33/302", 0x00000000, 0x8000,  8,    0x04,    0x10000000, 0x2000, 0x800, 0x400 },
22         { 0x3640C02B, "LPC1224FBD48/101", 0x00000000, 0x8000,  8,    0x04,    0x10000000, 0x1000, 0x800, 0x400 },
23         { 0x26011922, "LPC1764FBD100",    0x00000000, 0x10000, 16,   0x04,    0x10000000, 0x4000, 0x800, 0x800 },
24         {0, NULL, 0, 0, 0, 0, 0, 0, 0, 0},
25 };
28 struct part_desc* find_part(uint64_t dev_id)
29 {
30         int i = 0;
32         while (parts[i].name != NULL) {
33                 if (parts[i].part_id == dev_id) {
34                         return &parts[i];
35                 }
36                 i++;
37         }
39         return NULL;
40 }