├── .gitignore ├── 99-nuvoton_isp.rules ├── COPYING ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NucLibUsb.c ├── README ├── README.md ├── Serial.h ├── UXmodem.c ├── aclocal.m4 ├── common.h ├── compile ├── config.guess ├── config.h.in ├── config.sub ├── configure ├── configure.ac ├── crc32.c ├── depcomp ├── device.c ├── install-sh ├── main.c ├── missing ├── nudata ├── sys_cfg │ ├── N9H30F51I.ini │ ├── N9H30F51IEC.ini │ ├── N9H30F61IE.ini │ ├── N9H30F61IEC.ini │ ├── N9H30F71IE.ini │ ├── N9H30F71IEC.ini │ ├── N9H30K41I.ini │ ├── N9H30K41IEC.ini │ ├── N9H30K61I.ini │ ├── NUC972DF51Y.ini │ ├── NUC972DF61Y.ini │ ├── NUC972DF61YC.ini │ ├── NUC972DF62Y.ini │ ├── NUC972DF71Y.ini │ ├── NUC972DF71YC.ini │ ├── NUC973DF62Y.ini │ ├── NUC975DK51Y.ini │ ├── NUC975DK61Y.ini │ ├── NUC975DK62Y.ini │ ├── NUC976DK41Y.ini │ ├── NUC976DK51Y.ini │ ├── NUC976DK61Y.ini │ ├── NUC976DK61YC.ini │ ├── NUC976DK62Y.ini │ ├── NUC977DK41Y.ini │ ├── NUC977DK51Y.ini │ ├── NUC977DK61Y.ini │ ├── NUC977DK61YC.ini │ ├── NUC977DK62Y.ini │ ├── NUC977DK71Y.ini │ ├── NUC978DK41Y.ini │ ├── NUC978DK51Y.ini │ ├── NUC978DK61Y.ini │ ├── SCM601L216UE.ini │ ├── SCM602L128UE.ini │ ├── SCM603L128UE.ini │ └── SCM604L216VE.ini ├── xusb.bin ├── xusb128.bin ├── xusb16.bin └── xusb64.bin ├── parse.c └── read_file.c /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | *.o 4 | *.log 5 | 6 | .deps/ 7 | autom4te.cache/ 8 | Makefile 9 | config.h 10 | config.status 11 | 12 | stamp-h1 13 | nuwriter 14 | 15 | /install/ 16 | -------------------------------------------------------------------------------- /99-nuvoton_isp.rules: -------------------------------------------------------------------------------- 1 | # Nuvoton ISP Device Rule for NuWriter 2 | 3 | SUBSYSTEM=="usb", ATTRS{idVendor}=="0416", ATTRS{idProduct}=="5963", MODE="0666" 4 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Installation Instructions 2 | ************************* 3 | 4 | Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, 5 | Inc. 6 | 7 | Copying and distribution of this file, with or without modification, 8 | are permitted in any medium without royalty provided the copyright 9 | notice and this notice are preserved. This file is offered as-is, 10 | without warranty of any kind. 11 | 12 | Basic Installation 13 | ================== 14 | 15 | Briefly, the shell command `./configure && make && make install' 16 | should configure, build, and install this package. The following 17 | more-detailed instructions are generic; see the `README' file for 18 | instructions specific to this package. Some packages provide this 19 | `INSTALL' file but do not implement all of the features documented 20 | below. The lack of an optional feature in a given package is not 21 | necessarily a bug. More recommendations for GNU packages can be found 22 | in *note Makefile Conventions: (standards)Makefile Conventions. 23 | 24 | The `configure' shell script attempts to guess correct values for 25 | various system-dependent variables used during compilation. It uses 26 | those values to create a `Makefile' in each directory of the package. 27 | It may also create one or more `.h' files containing system-dependent 28 | definitions. Finally, it creates a shell script `config.status' that 29 | you can run in the future to recreate the current configuration, and a 30 | file `config.log' containing compiler output (useful mainly for 31 | debugging `configure'). 32 | 33 | It can also use an optional file (typically called `config.cache' 34 | and enabled with `--cache-file=config.cache' or simply `-C') that saves 35 | the results of its tests to speed up reconfiguring. Caching is 36 | disabled by default to prevent problems with accidental use of stale 37 | cache files. 38 | 39 | If you need to do unusual things to compile the package, please try 40 | to figure out how `configure' could check whether to do them, and mail 41 | diffs or instructions to the address given in the `README' so they can 42 | be considered for the next release. If you are using the cache, and at 43 | some point `config.cache' contains results you don't want to keep, you 44 | may remove or edit it. 45 | 46 | The file `configure.ac' (or `configure.in') is used to create 47 | `configure' by a program called `autoconf'. You need `configure.ac' if 48 | you want to change it or regenerate `configure' using a newer version 49 | of `autoconf'. 50 | 51 | The simplest way to compile this package is: 52 | 53 | 1. `cd' to the directory containing the package's source code and type 54 | `./configure' to configure the package for your system. 55 | 56 | Running `configure' might take a while. While running, it prints 57 | some messages telling which features it is checking for. 58 | 59 | 2. Type `make' to compile the package. 60 | 61 | 3. Optionally, type `make check' to run any self-tests that come with 62 | the package, generally using the just-built uninstalled binaries. 63 | 64 | 4. Type `make install' to install the programs and any data files and 65 | documentation. When installing into a prefix owned by root, it is 66 | recommended that the package be configured and built as a regular 67 | user, and only the `make install' phase executed with root 68 | privileges. 69 | 70 | 5. Optionally, type `make installcheck' to repeat any self-tests, but 71 | this time using the binaries in their final installed location. 72 | This target does not install anything. Running this target as a 73 | regular user, particularly if the prior `make install' required 74 | root privileges, verifies that the installation completed 75 | correctly. 76 | 77 | 6. You can remove the program binaries and object files from the 78 | source code directory by typing `make clean'. To also remove the 79 | files that `configure' created (so you can compile the package for 80 | a different kind of computer), type `make distclean'. There is 81 | also a `make maintainer-clean' target, but that is intended mainly 82 | for the package's developers. If you use it, you may have to get 83 | all sorts of other programs in order to regenerate files that came 84 | with the distribution. 85 | 86 | 7. Often, you can also type `make uninstall' to remove the installed 87 | files again. In practice, not all packages have tested that 88 | uninstallation works correctly, even though it is required by the 89 | GNU Coding Standards. 90 | 91 | 8. Some packages, particularly those that use Automake, provide `make 92 | distcheck', which can by used by developers to test that all other 93 | targets like `make install' and `make uninstall' work correctly. 94 | This target is generally not run by end users. 95 | 96 | Compilers and Options 97 | ===================== 98 | 99 | Some systems require unusual options for compilation or linking that 100 | the `configure' script does not know about. Run `./configure --help' 101 | for details on some of the pertinent environment variables. 102 | 103 | You can give `configure' initial values for configuration parameters 104 | by setting variables in the command line or in the environment. Here 105 | is an example: 106 | 107 | ./configure CC=c99 CFLAGS=-g LIBS=-lposix 108 | 109 | *Note Defining Variables::, for more details. 110 | 111 | Compiling For Multiple Architectures 112 | ==================================== 113 | 114 | You can compile the package for more than one kind of computer at the 115 | same time, by placing the object files for each architecture in their 116 | own directory. To do this, you can use GNU `make'. `cd' to the 117 | directory where you want the object files and executables to go and run 118 | the `configure' script. `configure' automatically checks for the 119 | source code in the directory that `configure' is in and in `..'. This 120 | is known as a "VPATH" build. 121 | 122 | With a non-GNU `make', it is safer to compile the package for one 123 | architecture at a time in the source code directory. After you have 124 | installed the package for one architecture, use `make distclean' before 125 | reconfiguring for another architecture. 126 | 127 | On MacOS X 10.5 and later systems, you can create libraries and 128 | executables that work on multiple system types--known as "fat" or 129 | "universal" binaries--by specifying multiple `-arch' options to the 130 | compiler but only a single `-arch' option to the preprocessor. Like 131 | this: 132 | 133 | ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ 134 | CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ 135 | CPP="gcc -E" CXXCPP="g++ -E" 136 | 137 | This is not guaranteed to produce working output in all cases, you 138 | may have to build one architecture at a time and combine the results 139 | using the `lipo' tool if you have problems. 140 | 141 | Installation Names 142 | ================== 143 | 144 | By default, `make install' installs the package's commands under 145 | `/usr/local/bin', include files under `/usr/local/include', etc. You 146 | can specify an installation prefix other than `/usr/local' by giving 147 | `configure' the option `--prefix=PREFIX', where PREFIX must be an 148 | absolute file name. 149 | 150 | You can specify separate installation prefixes for 151 | architecture-specific files and architecture-independent files. If you 152 | pass the option `--exec-prefix=PREFIX' to `configure', the package uses 153 | PREFIX as the prefix for installing programs and libraries. 154 | Documentation and other data files still use the regular prefix. 155 | 156 | In addition, if you use an unusual directory layout you can give 157 | options like `--bindir=DIR' to specify different values for particular 158 | kinds of files. Run `configure --help' for a list of the directories 159 | you can set and what kinds of files go in them. In general, the 160 | default for these options is expressed in terms of `${prefix}', so that 161 | specifying just `--prefix' will affect all of the other directory 162 | specifications that were not explicitly provided. 163 | 164 | The most portable way to affect installation locations is to pass the 165 | correct locations to `configure'; however, many packages provide one or 166 | both of the following shortcuts of passing variable assignments to the 167 | `make install' command line to change installation locations without 168 | having to reconfigure or recompile. 169 | 170 | The first method involves providing an override variable for each 171 | affected directory. For example, `make install 172 | prefix=/alternate/directory' will choose an alternate location for all 173 | directory configuration variables that were expressed in terms of 174 | `${prefix}'. Any directories that were specified during `configure', 175 | but not in terms of `${prefix}', must each be overridden at install 176 | time for the entire installation to be relocated. The approach of 177 | makefile variable overrides for each directory variable is required by 178 | the GNU Coding Standards, and ideally causes no recompilation. 179 | However, some platforms have known limitations with the semantics of 180 | shared libraries that end up requiring recompilation when using this 181 | method, particularly noticeable in packages that use GNU Libtool. 182 | 183 | The second method involves providing the `DESTDIR' variable. For 184 | example, `make install DESTDIR=/alternate/directory' will prepend 185 | `/alternate/directory' before all installation names. The approach of 186 | `DESTDIR' overrides is not required by the GNU Coding Standards, and 187 | does not work on platforms that have drive letters. On the other hand, 188 | it does better at avoiding recompilation issues, and works well even 189 | when some directory options were not specified in terms of `${prefix}' 190 | at `configure' time. 191 | 192 | Optional Features 193 | ================= 194 | 195 | If the package supports it, you can cause programs to be installed 196 | with an extra prefix or suffix on their names by giving `configure' the 197 | option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. 198 | 199 | Some packages pay attention to `--enable-FEATURE' options to 200 | `configure', where FEATURE indicates an optional part of the package. 201 | They may also pay attention to `--with-PACKAGE' options, where PACKAGE 202 | is something like `gnu-as' or `x' (for the X Window System). The 203 | `README' should mention any `--enable-' and `--with-' options that the 204 | package recognizes. 205 | 206 | For packages that use the X Window System, `configure' can usually 207 | find the X include and library files automatically, but if it doesn't, 208 | you can use the `configure' options `--x-includes=DIR' and 209 | `--x-libraries=DIR' to specify their locations. 210 | 211 | Some packages offer the ability to configure how verbose the 212 | execution of `make' will be. For these packages, running `./configure 213 | --enable-silent-rules' sets the default to minimal output, which can be 214 | overridden with `make V=1'; while running `./configure 215 | --disable-silent-rules' sets the default to verbose, which can be 216 | overridden with `make V=0'. 217 | 218 | Particular systems 219 | ================== 220 | 221 | On HP-UX, the default C compiler is not ANSI C compatible. If GNU 222 | CC is not installed, it is recommended to use the following options in 223 | order to use an ANSI C compiler: 224 | 225 | ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" 226 | 227 | and if that doesn't work, install pre-built binaries of GCC for HP-UX. 228 | 229 | HP-UX `make' updates targets which have the same time stamps as 230 | their prerequisites, which makes it generally unusable when shipped 231 | generated files such as `configure' are involved. Use GNU `make' 232 | instead. 233 | 234 | On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot 235 | parse its `' header file. The option `-nodtk' can be used as 236 | a workaround. If GNU CC is not installed, it is therefore recommended 237 | to try 238 | 239 | ./configure CC="cc" 240 | 241 | and if that doesn't work, try 242 | 243 | ./configure CC="cc -nodtk" 244 | 245 | On Solaris, don't put `/usr/ucb' early in your `PATH'. This 246 | directory contains several dysfunctional programs; working variants of 247 | these programs are available in `/usr/bin'. So, if you need `/usr/ucb' 248 | in your `PATH', put it _after_ `/usr/bin'. 249 | 250 | On Haiku, software installed for all users goes in `/boot/common', 251 | not `/usr/local'. It is recommended to use the following options: 252 | 253 | ./configure --prefix=/boot/common 254 | 255 | Specifying the System Type 256 | ========================== 257 | 258 | There may be some features `configure' cannot figure out 259 | automatically, but needs to determine by the type of machine the package 260 | will run on. Usually, assuming the package is built to be run on the 261 | _same_ architectures, `configure' can figure that out, but if it prints 262 | a message saying it cannot guess the machine type, give it the 263 | `--build=TYPE' option. TYPE can either be a short name for the system 264 | type, such as `sun4', or a canonical name which has the form: 265 | 266 | CPU-COMPANY-SYSTEM 267 | 268 | where SYSTEM can have one of these forms: 269 | 270 | OS 271 | KERNEL-OS 272 | 273 | See the file `config.sub' for the possible values of each field. If 274 | `config.sub' isn't included in this package, then this package doesn't 275 | need to know the machine type. 276 | 277 | If you are _building_ compiler tools for cross-compiling, you should 278 | use the option `--target=TYPE' to select the type of system they will 279 | produce code for. 280 | 281 | If you want to _use_ a cross compiler, that generates code for a 282 | platform different from the build platform, you should specify the 283 | "host" platform (i.e., that on which the generated programs will 284 | eventually be run) with `--host=TYPE'. 285 | 286 | Sharing Defaults 287 | ================ 288 | 289 | If you want to set default values for `configure' scripts to share, 290 | you can create a site shell script called `config.site' that gives 291 | default values for variables like `CC', `cache_file', and `prefix'. 292 | `configure' looks for `PREFIX/share/config.site' if it exists, then 293 | `PREFIX/etc/config.site' if it exists. Or, you can set the 294 | `CONFIG_SITE' environment variable to the location of the site script. 295 | A warning: not all `configure' scripts look for a site script. 296 | 297 | Defining Variables 298 | ================== 299 | 300 | Variables not defined in a site shell script can be set in the 301 | environment passed to `configure'. However, some packages may run 302 | configure again during the build, and the customized values of these 303 | variables may be lost. In order to avoid this problem, you should set 304 | them in the `configure' command line, using `VAR=value'. For example: 305 | 306 | ./configure CC=/usr/local2/bin/gcc 307 | 308 | causes the specified `gcc' to be used as the C compiler (unless it is 309 | overridden in the site shell script). 310 | 311 | Unfortunately, this technique does not work for `CONFIG_SHELL' due to 312 | an Autoconf limitation. Until the limitation is lifted, you can use 313 | this workaround: 314 | 315 | CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 316 | 317 | `configure' Invocation 318 | ====================== 319 | 320 | `configure' recognizes the following options to control how it 321 | operates. 322 | 323 | `--help' 324 | `-h' 325 | Print a summary of all of the options to `configure', and exit. 326 | 327 | `--help=short' 328 | `--help=recursive' 329 | Print a summary of the options unique to this package's 330 | `configure', and exit. The `short' variant lists options used 331 | only in the top level, while the `recursive' variant lists options 332 | also present in any nested packages. 333 | 334 | `--version' 335 | `-V' 336 | Print the version of Autoconf used to generate the `configure' 337 | script, and exit. 338 | 339 | `--cache-file=FILE' 340 | Enable the cache: use and save the results of the tests in FILE, 341 | traditionally `config.cache'. FILE defaults to `/dev/null' to 342 | disable caching. 343 | 344 | `--config-cache' 345 | `-C' 346 | Alias for `--cache-file=config.cache'. 347 | 348 | `--quiet' 349 | `--silent' 350 | `-q' 351 | Do not print messages saying which checks are being made. To 352 | suppress all normal output, redirect it to `/dev/null' (any error 353 | messages will still be shown). 354 | 355 | `--srcdir=DIR' 356 | Look for the package's source code in directory DIR. Usually 357 | `configure' can determine that directory automatically. 358 | 359 | `--prefix=DIR' 360 | Use DIR as the installation prefix. *note Installation Names:: 361 | for more details, including other options available for fine-tuning 362 | the installation locations. 363 | 364 | `--no-create' 365 | `-n' 366 | Run the configure checks, but stop before creating any output 367 | files. 368 | 369 | `configure' also accepts some other, not widely useful, options. Run 370 | `configure --help' for more details. 371 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AUTOMAKE_OPTIONS=foreign 3 | bin_PROGRAMS=nuwriter 4 | nuwriter_SOURCES= common.h Serial.h main.c read_file.c device.c NucLibUsb.c parse.c UXmodem.c crc32.c 5 | 6 | EXTRA_DIST = nudata README.md 7 | 8 | nudata_dir = $(prefix)/share/nudata/ 9 | nudata__DATA = nudata/xusb64.bin \ 10 | nudata/xusb128.bin \ 11 | nudata/xusb.bin \ 12 | nudata/xusb16.bin 13 | 14 | syscfg_dir = $(prefix)/share/nudata/sys_cfg 15 | syscfg__DATA = nudata/sys_cfg/NUC972DF51Y.ini \ 16 | nudata/sys_cfg/NUC972DF61Y.ini \ 17 | nudata/sys_cfg/NUC972DF62Y.ini \ 18 | nudata/sys_cfg/NUC972DF71Y.ini \ 19 | nudata/sys_cfg/NUC973DF62Y.ini \ 20 | nudata/sys_cfg/NUC975DK51Y.ini \ 21 | nudata/sys_cfg/NUC975DK62Y.ini \ 22 | nudata/sys_cfg/NUC976DK41Y.ini \ 23 | nudata/sys_cfg/NUC976DK51Y.ini \ 24 | nudata/sys_cfg/NUC976DK62Y.ini \ 25 | nudata/sys_cfg/NUC977DK41Y.ini \ 26 | nudata/sys_cfg/NUC977DK51Y.ini \ 27 | nudata/sys_cfg/NUC977DK62Y.ini 28 | 29 | #image_dir = $(prefix)/share/nudata/image 30 | #image__DATA = nudata/image/nand_uboot_spl.bin \ 31 | # nudata/image/nand_uboot.bin \ 32 | # nudata/image/nand_env.txt \ 33 | # nudata/image/nand_pack.bin \ 34 | # nudata/image/spi_uboot.bin \ 35 | # nudata/image/spi_env.txt \ 36 | # nudata/image/spi_pack.bin \ 37 | # nudata/image/emmc_uboot.bin \ 38 | # nudata/image/emmc_env.txt \ 39 | # nudata/image/emmc_pack.bin \ 40 | # nudata/image/kernel_970uimage 41 | 42 | LIBS =$(LIBUSB_CFLAGS) $(LIBUSB_LIBS) -lpthread 43 | CFLAGS = $(LIBUSB_CFLAGS) 44 | 45 | -------------------------------------------------------------------------------- /NucLibUsb.c: -------------------------------------------------------------------------------- 1 | 2 | #include "common.h" 3 | 4 | int NUC_SetType(int id,int type) 5 | { 6 | unsigned int ack=0; 7 | do { 8 | 9 | libusb_control_transfer(handle, 10 | 0x40, /* requesttype */ 11 | BURN, /* request */ 12 | BURN_TYPE+(unsigned int)type, /* wValue */ 13 | 0, /* wIndex */ 14 | NULL, 15 | 0, /* wLength */ 16 | USB_TIMEOUT); 17 | libusb_control_transfer(handle, 18 | 0xC0, /* requesttype */ 19 | BURN, /* request */ 20 | BURN_TYPE+(unsigned int)type, /* wValue */ 21 | 0, /* wIndex */ 22 | (unsigned char *)&ack, 23 | (unsigned short)sizeof(unsigned int), /* wLength */ 24 | USB_TIMEOUT); 25 | 26 | } while((unsigned char)(ack&0xFF)!=(BURN_TYPE+type)); 27 | return 0; 28 | } 29 | 30 | 31 | int NUC_ReadPipe(int id,unsigned char *buf,int len) 32 | { 33 | int nread, ret; 34 | 35 | ret = libusb_bulk_transfer(handle, USB_ENDPOINT_IN, buf, len, 36 | &nread, USB_TIMEOUT); 37 | if (ret) { 38 | MSG_DEBUG("ERROR in bulk read: %d\n", ret); 39 | return -1; 40 | } else { 41 | //MSG_DEBUG("receive %d bytes from device\n", nread); 42 | //printf("%s", receiveBuf); //Use this for benchmarking purposes 43 | return 0; 44 | } 45 | } 46 | int NUC_WritePipe(int id,unsigned char *buf,int len) 47 | { 48 | 49 | int ret; 50 | int nwrite; 51 | 52 | libusb_control_transfer(handle, 53 | 0x40, /* requesttype */ 54 | 0xA0, /* request */ 55 | 0x12, /* wValue */ 56 | len, /* wIndex */ 57 | buf, 58 | 0, /* wLength */ 59 | USB_TIMEOUT); 60 | 61 | 62 | //write transfer 63 | //probably unsafe to use n twice... 64 | ret = libusb_bulk_transfer(handle, USB_ENDPOINT_OUT, buf, len, &nwrite, USB_TIMEOUT); 65 | //Error handling 66 | switch(ret) { 67 | case 0: 68 | //MSG_DEBUG("send %d bytes to device\n", len); 69 | return 0; 70 | case LIBUSB_ERROR_TIMEOUT: 71 | printf("ERROR in bulk write: %d Timeout\n", ret); 72 | break; 73 | case LIBUSB_ERROR_PIPE: 74 | printf("ERROR in bulk write: %d Pipe\n", ret); 75 | break; 76 | case LIBUSB_ERROR_OVERFLOW: 77 | printf("ERROR in bulk write: %d Overflow\n", ret); 78 | break; 79 | case LIBUSB_ERROR_NO_DEVICE: 80 | printf("ERROR in bulk write: %d No Device\n", ret); 81 | break; 82 | default: 83 | printf("ERROR in bulk write: %d\n", ret); 84 | break; 85 | 86 | } 87 | return 0; 88 | } 89 | 90 | int compare_port_path(uint8_t *port_numbers1,int port_numbers_len1,uint8_t *port_numbers2,int port_numbers_len2) 91 | { 92 | int iRet; 93 | int i; 94 | 95 | if(port_numbers_len1 != port_numbers_len2) { 96 | iRet = port_numbers_len1-port_numbers_len1; 97 | } 98 | 99 | for(i=0; i< port_numbers_len1; i++) { 100 | if(port_numbers1[i] != port_numbers2[i]) { 101 | iRet = port_numbers1[i] - port_numbers2[i]; 102 | break; 103 | } 104 | } 105 | 106 | return iRet; 107 | 108 | } 109 | 110 | void sort_dev_array(libusb_device **dev_arr,int count) 111 | { 112 | int i,j; 113 | libusb_device *tmp; 114 | uint8_t port_numbers1[8]; 115 | uint8_t port_numbers2[8]; 116 | int port_numbers_len1; 117 | int port_numbers_len2; 118 | for(int i=0; ii; j--) { 120 | port_numbers_len1 = libusb_get_port_numbers(dev_arr[j-1],port_numbers1,sizeof(port_numbers1)); 121 | port_numbers_len2 = libusb_get_port_numbers(dev_arr[j],port_numbers2,sizeof(port_numbers2)); 122 | if(compare_port_path(port_numbers1,port_numbers_len1,port_numbers2,port_numbers_len2) > 0 ) { 123 | tmp = dev_arr[j-1]; 124 | dev_arr[j-1] = dev_arr[j]; 125 | dev_arr[j] = tmp; 126 | } 127 | } 128 | } 129 | 130 | } 131 | 132 | void print_port_numbers(libusb_device *dev) 133 | { 134 | uint8_t port_numbers[8]; 135 | int port_numbers_len; 136 | int i; 137 | port_numbers_len = libusb_get_port_numbers(dev,port_numbers,sizeof(port_numbers)); 138 | if(port_numbers_len > 0) { 139 | MSG_DEBUG(" %d", port_numbers[0]); 140 | for (i = 1; i 6 | #include 7 | #include 8 | #include 9 | #include /* sleep/usleep*/ 10 | /* change if your libusb.h is located elswhere */ 11 | #include 12 | #include "Serial.h" 13 | 14 | 15 | /* for upgrade */ 16 | #define USBD_FLASH_SDRAM 0x0 17 | #define USBD_FLASH_NAND 0x3 18 | #define USBD_FLASH_NAND_RAW 0x4 19 | #define USBD_FLASH_MMC 0x5 20 | #define USBD_FLASH_MMC_RAW 0x6 21 | #define USBD_FLASH_SPI 0x7 22 | #define USBD_FLASH_SPI_RAW 0x8 23 | #define USBD_MTP 0x9 24 | #define USBD_INFO 0xA 25 | #define USBD_BURN_TYPE 0x80 26 | 27 | 28 | #define USB_VENDOR_ID 0x0416 /* USB vendor ID used by the device */ 29 | #define USB_PRODUCT_ID 0x5963 /* USB product ID used by the device */ 30 | 31 | #define USB_ENDPOINT_IN (LIBUSB_ENDPOINT_IN | 1) /* endpoint address */ 32 | #define USB_ENDPOINT_OUT (LIBUSB_ENDPOINT_OUT | 2) /* endpoint address */ 33 | #define USB_TIMEOUT (10000) /* Connection timeout (in ms) */ 34 | 35 | 36 | 37 | #define DDRADDRESS 16 38 | #define BUF_SIZE 4096 39 | 40 | #define SDRAM_M 0 41 | #define NAND_M 1 42 | #define EMMC_M 2 43 | #define SPI_M 3 44 | 45 | 46 | #define RUN_ON_XUSB 0x08FF0001 47 | 48 | #if 0 49 | #define MSG_DEBUG printf 50 | #else 51 | #define MSG_DEBUG(...) 52 | #endif 53 | 54 | 55 | #define MAX_DEV 8 56 | 57 | /* load_file.c */ 58 | extern char* load_ddr(char *FilePath,int *len); 59 | extern char * load_xusb(char *FilePath,int *len); 60 | 61 | 62 | /* NuclibUsb.c */ 63 | extern int NUC_OpenUsb(void); 64 | extern void NUC_CloseUsb(void); 65 | extern int NUC_SetType(int id,int type); 66 | extern int NUC_ReadPipe(int id,unsigned char *buf,int len); 67 | extern int NUC_WritePipe(int id,unsigned char *buf,int len); 68 | extern int get_device_num_with_vid_pid(libusb_context *ctx,unsigned int vendor_id,unsigned int product_id); 69 | 70 | /* device.c */ 71 | extern int XUSBtoDevice(unsigned char *buf,unsigned int len); 72 | extern int DDRtoDevice(unsigned char *buf,unsigned int len); 73 | int InfoFromDevice(void); 74 | 75 | /* parse.c */ 76 | extern int ParseFlashType(void); 77 | extern int init_xusb(void); 78 | 79 | /* UXmodem.c */ 80 | extern int UXmodem_SDRAM(void); 81 | extern int UXmodem_NAND(void); 82 | extern int UXmodem_SPI(void); 83 | extern int UXmodem_EMMC(void); 84 | 85 | /* crc32.c */ 86 | unsigned int CalculateCRC32(unsigned char * buf,unsigned int len); 87 | 88 | /* gloabel */ 89 | extern char DDR_fileName[128]; 90 | extern char write_file[256]; 91 | extern char read_file[256]; 92 | extern char Data_Path[256]; 93 | extern int mode; 94 | extern int type; 95 | extern unsigned int exe_addr; 96 | extern unsigned int dram_run; 97 | extern unsigned int erase_read_len; 98 | extern int erase_tag; 99 | extern int read_tag; 100 | extern int write_tag; 101 | extern int verify_tag; 102 | extern int dtb_tag; 103 | extern unsigned int dtb_addr; 104 | 105 | extern struct _INFO_T m_info; 106 | 107 | extern libusb_context *ctx; 108 | extern libusb_device_handle *handle; 109 | 110 | extern unsigned int csg_usb_index; 111 | extern libusb_device *dev_arr[MAX_DEV]; 112 | extern unsigned int dev_count; 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /compile: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Wrapper for compilers which do not understand '-c -o'. 3 | 4 | scriptversion=2012-10-14.11; # UTC 5 | 6 | # Copyright (C) 1999-2014 Free Software Foundation, Inc. 7 | # Written by Tom Tromey . 8 | # 9 | # This program is free software; you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 2, or (at your option) 12 | # any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | # This file is maintained in Automake, please report 28 | # bugs to or send patches to 29 | # . 30 | 31 | nl=' 32 | ' 33 | 34 | # We need space, tab and new line, in precisely that order. Quoting is 35 | # there to prevent tools from complaining about whitespace usage. 36 | IFS=" "" $nl" 37 | 38 | file_conv= 39 | 40 | # func_file_conv build_file lazy 41 | # Convert a $build file to $host form and store it in $file 42 | # Currently only supports Windows hosts. If the determined conversion 43 | # type is listed in (the comma separated) LAZY, no conversion will 44 | # take place. 45 | func_file_conv () 46 | { 47 | file=$1 48 | case $file in 49 | / | /[!/]*) # absolute file, and not a UNC file 50 | if test -z "$file_conv"; then 51 | # lazily determine how to convert abs files 52 | case `uname -s` in 53 | MINGW*) 54 | file_conv=mingw 55 | ;; 56 | CYGWIN*) 57 | file_conv=cygwin 58 | ;; 59 | *) 60 | file_conv=wine 61 | ;; 62 | esac 63 | fi 64 | case $file_conv/,$2, in 65 | *,$file_conv,*) 66 | ;; 67 | mingw/*) 68 | file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` 69 | ;; 70 | cygwin/*) 71 | file=`cygpath -m "$file" || echo "$file"` 72 | ;; 73 | wine/*) 74 | file=`winepath -w "$file" || echo "$file"` 75 | ;; 76 | esac 77 | ;; 78 | esac 79 | } 80 | 81 | # func_cl_dashL linkdir 82 | # Make cl look for libraries in LINKDIR 83 | func_cl_dashL () 84 | { 85 | func_file_conv "$1" 86 | if test -z "$lib_path"; then 87 | lib_path=$file 88 | else 89 | lib_path="$lib_path;$file" 90 | fi 91 | linker_opts="$linker_opts -LIBPATH:$file" 92 | } 93 | 94 | # func_cl_dashl library 95 | # Do a library search-path lookup for cl 96 | func_cl_dashl () 97 | { 98 | lib=$1 99 | found=no 100 | save_IFS=$IFS 101 | IFS=';' 102 | for dir in $lib_path $LIB 103 | do 104 | IFS=$save_IFS 105 | if $shared && test -f "$dir/$lib.dll.lib"; then 106 | found=yes 107 | lib=$dir/$lib.dll.lib 108 | break 109 | fi 110 | if test -f "$dir/$lib.lib"; then 111 | found=yes 112 | lib=$dir/$lib.lib 113 | break 114 | fi 115 | if test -f "$dir/lib$lib.a"; then 116 | found=yes 117 | lib=$dir/lib$lib.a 118 | break 119 | fi 120 | done 121 | IFS=$save_IFS 122 | 123 | if test "$found" != yes; then 124 | lib=$lib.lib 125 | fi 126 | } 127 | 128 | # func_cl_wrapper cl arg... 129 | # Adjust compile command to suit cl 130 | func_cl_wrapper () 131 | { 132 | # Assume a capable shell 133 | lib_path= 134 | shared=: 135 | linker_opts= 136 | for arg 137 | do 138 | if test -n "$eat"; then 139 | eat= 140 | else 141 | case $1 in 142 | -o) 143 | # configure might choose to run compile as 'compile cc -o foo foo.c'. 144 | eat=1 145 | case $2 in 146 | *.o | *.[oO][bB][jJ]) 147 | func_file_conv "$2" 148 | set x "$@" -Fo"$file" 149 | shift 150 | ;; 151 | *) 152 | func_file_conv "$2" 153 | set x "$@" -Fe"$file" 154 | shift 155 | ;; 156 | esac 157 | ;; 158 | -I) 159 | eat=1 160 | func_file_conv "$2" mingw 161 | set x "$@" -I"$file" 162 | shift 163 | ;; 164 | -I*) 165 | func_file_conv "${1#-I}" mingw 166 | set x "$@" -I"$file" 167 | shift 168 | ;; 169 | -l) 170 | eat=1 171 | func_cl_dashl "$2" 172 | set x "$@" "$lib" 173 | shift 174 | ;; 175 | -l*) 176 | func_cl_dashl "${1#-l}" 177 | set x "$@" "$lib" 178 | shift 179 | ;; 180 | -L) 181 | eat=1 182 | func_cl_dashL "$2" 183 | ;; 184 | -L*) 185 | func_cl_dashL "${1#-L}" 186 | ;; 187 | -static) 188 | shared=false 189 | ;; 190 | -Wl,*) 191 | arg=${1#-Wl,} 192 | save_ifs="$IFS"; IFS=',' 193 | for flag in $arg; do 194 | IFS="$save_ifs" 195 | linker_opts="$linker_opts $flag" 196 | done 197 | IFS="$save_ifs" 198 | ;; 199 | -Xlinker) 200 | eat=1 201 | linker_opts="$linker_opts $2" 202 | ;; 203 | -*) 204 | set x "$@" "$1" 205 | shift 206 | ;; 207 | *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) 208 | func_file_conv "$1" 209 | set x "$@" -Tp"$file" 210 | shift 211 | ;; 212 | *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) 213 | func_file_conv "$1" mingw 214 | set x "$@" "$file" 215 | shift 216 | ;; 217 | *) 218 | set x "$@" "$1" 219 | shift 220 | ;; 221 | esac 222 | fi 223 | shift 224 | done 225 | if test -n "$linker_opts"; then 226 | linker_opts="-link$linker_opts" 227 | fi 228 | exec "$@" $linker_opts 229 | exit 1 230 | } 231 | 232 | eat= 233 | 234 | case $1 in 235 | '') 236 | echo "$0: No command. Try '$0 --help' for more information." 1>&2 237 | exit 1; 238 | ;; 239 | -h | --h*) 240 | cat <<\EOF 241 | Usage: compile [--help] [--version] PROGRAM [ARGS] 242 | 243 | Wrapper for compilers which do not understand '-c -o'. 244 | Remove '-o dest.o' from ARGS, run PROGRAM with the remaining 245 | arguments, and rename the output as expected. 246 | 247 | If you are trying to build a whole package this is not the 248 | right script to run: please start by reading the file 'INSTALL'. 249 | 250 | Report bugs to . 251 | EOF 252 | exit $? 253 | ;; 254 | -v | --v*) 255 | echo "compile $scriptversion" 256 | exit $? 257 | ;; 258 | cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) 259 | func_cl_wrapper "$@" # Doesn't return... 260 | ;; 261 | esac 262 | 263 | ofile= 264 | cfile= 265 | 266 | for arg 267 | do 268 | if test -n "$eat"; then 269 | eat= 270 | else 271 | case $1 in 272 | -o) 273 | # configure might choose to run compile as 'compile cc -o foo foo.c'. 274 | # So we strip '-o arg' only if arg is an object. 275 | eat=1 276 | case $2 in 277 | *.o | *.obj) 278 | ofile=$2 279 | ;; 280 | *) 281 | set x "$@" -o "$2" 282 | shift 283 | ;; 284 | esac 285 | ;; 286 | *.c) 287 | cfile=$1 288 | set x "$@" "$1" 289 | shift 290 | ;; 291 | *) 292 | set x "$@" "$1" 293 | shift 294 | ;; 295 | esac 296 | fi 297 | shift 298 | done 299 | 300 | if test -z "$ofile" || test -z "$cfile"; then 301 | # If no '-o' option was seen then we might have been invoked from a 302 | # pattern rule where we don't need one. That is ok -- this is a 303 | # normal compilation that the losing compiler can handle. If no 304 | # '.c' file was seen then we are probably linking. That is also 305 | # ok. 306 | exec "$@" 307 | fi 308 | 309 | # Name of file we expect compiler to create. 310 | cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` 311 | 312 | # Create the lock directory. 313 | # Note: use '[/\\:.-]' here to ensure that we don't use the same name 314 | # that we are using for the .o file. Also, base the name on the expected 315 | # object file name, since that is what matters with a parallel build. 316 | lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d 317 | while true; do 318 | if mkdir "$lockdir" >/dev/null 2>&1; then 319 | break 320 | fi 321 | sleep 1 322 | done 323 | # FIXME: race condition here if user kills between mkdir and trap. 324 | trap "rmdir '$lockdir'; exit 1" 1 2 15 325 | 326 | # Run the compile. 327 | "$@" 328 | ret=$? 329 | 330 | if test -f "$cofile"; then 331 | test "$cofile" = "$ofile" || mv "$cofile" "$ofile" 332 | elif test -f "${cofile}bj"; then 333 | test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" 334 | fi 335 | 336 | rmdir "$lockdir" 337 | exit $ret 338 | 339 | # Local Variables: 340 | # mode: shell-script 341 | # sh-indentation: 2 342 | # eval: (add-hook 'write-file-hooks 'time-stamp) 343 | # time-stamp-start: "scriptversion=" 344 | # time-stamp-format: "%:y-%02m-%02d.%02H" 345 | # time-stamp-time-zone: "UTC" 346 | # time-stamp-end: "; # UTC" 347 | # End: 348 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_INTTYPES_H 5 | 6 | /* Define to 1 if your system has a GNU libc compatible `malloc' function, and 7 | to 0 otherwise. */ 8 | #undef HAVE_MALLOC 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #undef HAVE_MEMORY_H 12 | 13 | /* Define to 1 if you have the `memset' function. */ 14 | #undef HAVE_MEMSET 15 | 16 | /* Define to 1 if you have the header file. */ 17 | #undef HAVE_STDINT_H 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #undef HAVE_STDLIB_H 21 | 22 | /* Define to 1 if you have the `strcasecmp' function. */ 23 | #undef HAVE_STRCASECMP 24 | 25 | /* Define to 1 if you have the `strchr' function. */ 26 | #undef HAVE_STRCHR 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #undef HAVE_STRINGS_H 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #undef HAVE_STRING_H 33 | 34 | /* Define to 1 if you have the `strtoul' function. */ 35 | #undef HAVE_STRTOUL 36 | 37 | /* Define to 1 if you have the header file. */ 38 | #undef HAVE_SYS_STAT_H 39 | 40 | /* Define to 1 if you have the header file. */ 41 | #undef HAVE_SYS_TYPES_H 42 | 43 | /* Define to 1 if you have the header file. */ 44 | #undef HAVE_UNISTD_H 45 | 46 | /* Define to 1 if the system has the type `_Bool'. */ 47 | #undef HAVE__BOOL 48 | 49 | /* Name of package */ 50 | #undef PACKAGE 51 | 52 | /* Define to the address where bug reports for this package should be sent. */ 53 | #undef PACKAGE_BUGREPORT 54 | 55 | /* Define to the full name of this package. */ 56 | #undef PACKAGE_NAME 57 | 58 | /* Define to the full name and version of this package. */ 59 | #undef PACKAGE_STRING 60 | 61 | /* Define to the one symbol short name of this package. */ 62 | #undef PACKAGE_TARNAME 63 | 64 | /* Define to the home page for this package. */ 65 | #undef PACKAGE_URL 66 | 67 | /* Define to the version of this package. */ 68 | #undef PACKAGE_VERSION 69 | 70 | /* Define to 1 if you have the ANSI C header files. */ 71 | #undef STDC_HEADERS 72 | 73 | /* Version number of package */ 74 | #undef VERSION 75 | 76 | /* Define for Solaris 2.5.1 so the uint8_t typedef from , 77 | , or is not used. If the typedef were allowed, the 78 | #define below would cause a syntax error. */ 79 | #undef _UINT8_T 80 | 81 | /* Define to rpl_malloc if the replacement function should be used. */ 82 | #undef malloc 83 | 84 | /* Define to `unsigned int' if does not define. */ 85 | #undef size_t 86 | 87 | /* Define to the type of an unsigned integer type of width exactly 8 bits if 88 | such a type exists and the standard includes do not define it. */ 89 | #undef uint8_t 90 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | AC_PREREQ([2.69]) 5 | AC_INIT([nuwriter], [1.0], [www.nuvoton.com.tw]) 6 | AM_INIT_AUTOMAKE 7 | AC_CONFIG_SRCDIR([main.c]) 8 | AC_CONFIG_HEADERS([config.h]) 9 | 10 | 11 | svn_enable_static=no 12 | 13 | dnl check for --enable-static option 14 | AC_ARG_ENABLE(static, 15 | AS_HELP_STRING([--enable-static], 16 | [Build static libraries]), 17 | [svn_enable_static="yes"]) 18 | if test "$svn_enable_static" = "yes"; then 19 | CFLAGS="-static $CFLAGS" 20 | LDFLAGS="-static $LDFLAGS" 21 | fi 22 | 23 | # Checks for programs. 24 | AC_PROG_CC 25 | 26 | # Checks for libraries. 27 | PKG_CHECK_MODULES(LIBUSB, libusb-1.0) 28 | 29 | # Checks for header files. 30 | AC_CHECK_HEADERS([stdlib.h string.h unistd.h]) 31 | 32 | 33 | # Checks for typedefs, structures, and compiler characteristics. 34 | AC_CHECK_HEADER_STDBOOL 35 | AC_TYPE_SIZE_T 36 | AC_TYPE_UINT8_T 37 | 38 | # Checks for library functions. 39 | AC_FUNC_MALLOC 40 | AC_CHECK_FUNCS([memset strcasecmp strchr strtoul]) 41 | 42 | AC_CONFIG_FILES([Makefile]) 43 | AC_OUTPUT 44 | -------------------------------------------------------------------------------- /crc32.c: -------------------------------------------------------------------------------- 1 | 2 | #include "common.h" 3 | 4 | #define CRC32POLY 0x04c11db7 5 | static const unsigned long crc32_table[256] = { 6 | 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 7 | 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 8 | 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 9 | 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 10 | 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 11 | 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 12 | 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 13 | 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 14 | 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 15 | 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 16 | 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 17 | 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 18 | 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 19 | 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 20 | 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 21 | 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 22 | 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 23 | 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 24 | 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 25 | 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 26 | 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 27 | 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 28 | 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 29 | 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 30 | 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 31 | 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 32 | 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 33 | 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 34 | 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 35 | 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 36 | 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 37 | 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 38 | 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 39 | 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 40 | 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 41 | 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 42 | 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 43 | 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 44 | 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 45 | 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 46 | 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 47 | 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 48 | 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 49 | 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 50 | 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 51 | 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 52 | 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 53 | 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 54 | 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 55 | 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 56 | 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 57 | 0x2d02ef8d 58 | }; 59 | 60 | unsigned int CalculateCRC32(unsigned char * buf,unsigned int len) 61 | { 62 | #if 0 63 | unsigned char *end; 64 | unsigned int crc=CRC32POLY; 65 | crc = ~crc; 66 | for (end = buf + len; buf < end; ++buf) 67 | crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8); 68 | return ~crc; 69 | #else 70 | unsigned int i; 71 | unsigned int crc32; 72 | unsigned char* byteBuf; 73 | crc32 = 0 ^ 0xFFFFFFFF; 74 | byteBuf = (unsigned char *) buf; 75 | for (i=0; i < len; i++) { 76 | crc32 = (crc32 >> 8) ^ crc32_table[ (crc32 ^ byteBuf[i]) & 0xFF ]; 77 | } 78 | return ( crc32 ^ 0xFFFFFFFF ); 79 | #endif 80 | } 81 | -------------------------------------------------------------------------------- /depcomp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # depcomp - compile a program generating dependencies as side-effects 3 | 4 | scriptversion=2013-05-30.07; # UTC 5 | 6 | # Copyright (C) 1999-2014 Free Software Foundation, Inc. 7 | 8 | # This program is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 2, or (at your option) 11 | # any later version. 12 | 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | 21 | # As a special exception to the GNU General Public License, if you 22 | # distribute this file as part of a program that contains a 23 | # configuration script generated by Autoconf, you may include it under 24 | # the same distribution terms that you use for the rest of that program. 25 | 26 | # Originally written by Alexandre Oliva . 27 | 28 | case $1 in 29 | '') 30 | echo "$0: No command. Try '$0 --help' for more information." 1>&2 31 | exit 1; 32 | ;; 33 | -h | --h*) 34 | cat <<\EOF 35 | Usage: depcomp [--help] [--version] PROGRAM [ARGS] 36 | 37 | Run PROGRAMS ARGS to compile a file, generating dependencies 38 | as side-effects. 39 | 40 | Environment variables: 41 | depmode Dependency tracking mode. 42 | source Source file read by 'PROGRAMS ARGS'. 43 | object Object file output by 'PROGRAMS ARGS'. 44 | DEPDIR directory where to store dependencies. 45 | depfile Dependency file to output. 46 | tmpdepfile Temporary file to use when outputting dependencies. 47 | libtool Whether libtool is used (yes/no). 48 | 49 | Report bugs to . 50 | EOF 51 | exit $? 52 | ;; 53 | -v | --v*) 54 | echo "depcomp $scriptversion" 55 | exit $? 56 | ;; 57 | esac 58 | 59 | # Get the directory component of the given path, and save it in the 60 | # global variables '$dir'. Note that this directory component will 61 | # be either empty or ending with a '/' character. This is deliberate. 62 | set_dir_from () 63 | { 64 | case $1 in 65 | */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; 66 | *) dir=;; 67 | esac 68 | } 69 | 70 | # Get the suffix-stripped basename of the given path, and save it the 71 | # global variable '$base'. 72 | set_base_from () 73 | { 74 | base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` 75 | } 76 | 77 | # If no dependency file was actually created by the compiler invocation, 78 | # we still have to create a dummy depfile, to avoid errors with the 79 | # Makefile "include basename.Plo" scheme. 80 | make_dummy_depfile () 81 | { 82 | echo "#dummy" > "$depfile" 83 | } 84 | 85 | # Factor out some common post-processing of the generated depfile. 86 | # Requires the auxiliary global variable '$tmpdepfile' to be set. 87 | aix_post_process_depfile () 88 | { 89 | # If the compiler actually managed to produce a dependency file, 90 | # post-process it. 91 | if test -f "$tmpdepfile"; then 92 | # Each line is of the form 'foo.o: dependency.h'. 93 | # Do two passes, one to just change these to 94 | # $object: dependency.h 95 | # and one to simply output 96 | # dependency.h: 97 | # which is needed to avoid the deleted-header problem. 98 | { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" 99 | sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" 100 | } > "$depfile" 101 | rm -f "$tmpdepfile" 102 | else 103 | make_dummy_depfile 104 | fi 105 | } 106 | 107 | # A tabulation character. 108 | tab=' ' 109 | # A newline character. 110 | nl=' 111 | ' 112 | # Character ranges might be problematic outside the C locale. 113 | # These definitions help. 114 | upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ 115 | lower=abcdefghijklmnopqrstuvwxyz 116 | digits=0123456789 117 | alpha=${upper}${lower} 118 | 119 | if test -z "$depmode" || test -z "$source" || test -z "$object"; then 120 | echo "depcomp: Variables source, object and depmode must be set" 1>&2 121 | exit 1 122 | fi 123 | 124 | # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. 125 | depfile=${depfile-`echo "$object" | 126 | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} 127 | tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} 128 | 129 | rm -f "$tmpdepfile" 130 | 131 | # Avoid interferences from the environment. 132 | gccflag= dashmflag= 133 | 134 | # Some modes work just like other modes, but use different flags. We 135 | # parameterize here, but still list the modes in the big case below, 136 | # to make depend.m4 easier to write. Note that we *cannot* use a case 137 | # here, because this file can only contain one case statement. 138 | if test "$depmode" = hp; then 139 | # HP compiler uses -M and no extra arg. 140 | gccflag=-M 141 | depmode=gcc 142 | fi 143 | 144 | if test "$depmode" = dashXmstdout; then 145 | # This is just like dashmstdout with a different argument. 146 | dashmflag=-xM 147 | depmode=dashmstdout 148 | fi 149 | 150 | cygpath_u="cygpath -u -f -" 151 | if test "$depmode" = msvcmsys; then 152 | # This is just like msvisualcpp but w/o cygpath translation. 153 | # Just convert the backslash-escaped backslashes to single forward 154 | # slashes to satisfy depend.m4 155 | cygpath_u='sed s,\\\\,/,g' 156 | depmode=msvisualcpp 157 | fi 158 | 159 | if test "$depmode" = msvc7msys; then 160 | # This is just like msvc7 but w/o cygpath translation. 161 | # Just convert the backslash-escaped backslashes to single forward 162 | # slashes to satisfy depend.m4 163 | cygpath_u='sed s,\\\\,/,g' 164 | depmode=msvc7 165 | fi 166 | 167 | if test "$depmode" = xlc; then 168 | # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. 169 | gccflag=-qmakedep=gcc,-MF 170 | depmode=gcc 171 | fi 172 | 173 | case "$depmode" in 174 | gcc3) 175 | ## gcc 3 implements dependency tracking that does exactly what 176 | ## we want. Yay! Note: for some reason libtool 1.4 doesn't like 177 | ## it if -MD -MP comes after the -MF stuff. Hmm. 178 | ## Unfortunately, FreeBSD c89 acceptance of flags depends upon 179 | ## the command line argument order; so add the flags where they 180 | ## appear in depend2.am. Note that the slowdown incurred here 181 | ## affects only configure: in makefiles, %FASTDEP% shortcuts this. 182 | for arg 183 | do 184 | case $arg in 185 | -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; 186 | *) set fnord "$@" "$arg" ;; 187 | esac 188 | shift # fnord 189 | shift # $arg 190 | done 191 | "$@" 192 | stat=$? 193 | if test $stat -ne 0; then 194 | rm -f "$tmpdepfile" 195 | exit $stat 196 | fi 197 | mv "$tmpdepfile" "$depfile" 198 | ;; 199 | 200 | gcc) 201 | ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. 202 | ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. 203 | ## (see the conditional assignment to $gccflag above). 204 | ## There are various ways to get dependency output from gcc. Here's 205 | ## why we pick this rather obscure method: 206 | ## - Don't want to use -MD because we'd like the dependencies to end 207 | ## up in a subdir. Having to rename by hand is ugly. 208 | ## (We might end up doing this anyway to support other compilers.) 209 | ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like 210 | ## -MM, not -M (despite what the docs say). Also, it might not be 211 | ## supported by the other compilers which use the 'gcc' depmode. 212 | ## - Using -M directly means running the compiler twice (even worse 213 | ## than renaming). 214 | if test -z "$gccflag"; then 215 | gccflag=-MD, 216 | fi 217 | "$@" -Wp,"$gccflag$tmpdepfile" 218 | stat=$? 219 | if test $stat -ne 0; then 220 | rm -f "$tmpdepfile" 221 | exit $stat 222 | fi 223 | rm -f "$depfile" 224 | echo "$object : \\" > "$depfile" 225 | # The second -e expression handles DOS-style file names with drive 226 | # letters. 227 | sed -e 's/^[^:]*: / /' \ 228 | -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" 229 | ## This next piece of magic avoids the "deleted header file" problem. 230 | ## The problem is that when a header file which appears in a .P file 231 | ## is deleted, the dependency causes make to die (because there is 232 | ## typically no way to rebuild the header). We avoid this by adding 233 | ## dummy dependencies for each header file. Too bad gcc doesn't do 234 | ## this for us directly. 235 | ## Some versions of gcc put a space before the ':'. On the theory 236 | ## that the space means something, we add a space to the output as 237 | ## well. hp depmode also adds that space, but also prefixes the VPATH 238 | ## to the object. Take care to not repeat it in the output. 239 | ## Some versions of the HPUX 10.20 sed can't process this invocation 240 | ## correctly. Breaking it into two sed invocations is a workaround. 241 | tr ' ' "$nl" < "$tmpdepfile" \ 242 | | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ 243 | | sed -e 's/$/ :/' >> "$depfile" 244 | rm -f "$tmpdepfile" 245 | ;; 246 | 247 | hp) 248 | # This case exists only to let depend.m4 do its work. It works by 249 | # looking at the text of this script. This case will never be run, 250 | # since it is checked for above. 251 | exit 1 252 | ;; 253 | 254 | sgi) 255 | if test "$libtool" = yes; then 256 | "$@" "-Wp,-MDupdate,$tmpdepfile" 257 | else 258 | "$@" -MDupdate "$tmpdepfile" 259 | fi 260 | stat=$? 261 | if test $stat -ne 0; then 262 | rm -f "$tmpdepfile" 263 | exit $stat 264 | fi 265 | rm -f "$depfile" 266 | 267 | if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files 268 | echo "$object : \\" > "$depfile" 269 | # Clip off the initial element (the dependent). Don't try to be 270 | # clever and replace this with sed code, as IRIX sed won't handle 271 | # lines with more than a fixed number of characters (4096 in 272 | # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; 273 | # the IRIX cc adds comments like '#:fec' to the end of the 274 | # dependency line. 275 | tr ' ' "$nl" < "$tmpdepfile" \ 276 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ 277 | | tr "$nl" ' ' >> "$depfile" 278 | echo >> "$depfile" 279 | # The second pass generates a dummy entry for each header file. 280 | tr ' ' "$nl" < "$tmpdepfile" \ 281 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ 282 | >> "$depfile" 283 | else 284 | make_dummy_depfile 285 | fi 286 | rm -f "$tmpdepfile" 287 | ;; 288 | 289 | xlc) 290 | # This case exists only to let depend.m4 do its work. It works by 291 | # looking at the text of this script. This case will never be run, 292 | # since it is checked for above. 293 | exit 1 294 | ;; 295 | 296 | aix) 297 | # The C for AIX Compiler uses -M and outputs the dependencies 298 | # in a .u file. In older versions, this file always lives in the 299 | # current directory. Also, the AIX compiler puts '$object:' at the 300 | # start of each line; $object doesn't have directory information. 301 | # Version 6 uses the directory in both cases. 302 | set_dir_from "$object" 303 | set_base_from "$object" 304 | if test "$libtool" = yes; then 305 | tmpdepfile1=$dir$base.u 306 | tmpdepfile2=$base.u 307 | tmpdepfile3=$dir.libs/$base.u 308 | "$@" -Wc,-M 309 | else 310 | tmpdepfile1=$dir$base.u 311 | tmpdepfile2=$dir$base.u 312 | tmpdepfile3=$dir$base.u 313 | "$@" -M 314 | fi 315 | stat=$? 316 | if test $stat -ne 0; then 317 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 318 | exit $stat 319 | fi 320 | 321 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 322 | do 323 | test -f "$tmpdepfile" && break 324 | done 325 | aix_post_process_depfile 326 | ;; 327 | 328 | tcc) 329 | # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 330 | # FIXME: That version still under development at the moment of writing. 331 | # Make that this statement remains true also for stable, released 332 | # versions. 333 | # It will wrap lines (doesn't matter whether long or short) with a 334 | # trailing '\', as in: 335 | # 336 | # foo.o : \ 337 | # foo.c \ 338 | # foo.h \ 339 | # 340 | # It will put a trailing '\' even on the last line, and will use leading 341 | # spaces rather than leading tabs (at least since its commit 0394caf7 342 | # "Emit spaces for -MD"). 343 | "$@" -MD -MF "$tmpdepfile" 344 | stat=$? 345 | if test $stat -ne 0; then 346 | rm -f "$tmpdepfile" 347 | exit $stat 348 | fi 349 | rm -f "$depfile" 350 | # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. 351 | # We have to change lines of the first kind to '$object: \'. 352 | sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" 353 | # And for each line of the second kind, we have to emit a 'dep.h:' 354 | # dummy dependency, to avoid the deleted-header problem. 355 | sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" 356 | rm -f "$tmpdepfile" 357 | ;; 358 | 359 | ## The order of this option in the case statement is important, since the 360 | ## shell code in configure will try each of these formats in the order 361 | ## listed in this file. A plain '-MD' option would be understood by many 362 | ## compilers, so we must ensure this comes after the gcc and icc options. 363 | pgcc) 364 | # Portland's C compiler understands '-MD'. 365 | # Will always output deps to 'file.d' where file is the root name of the 366 | # source file under compilation, even if file resides in a subdirectory. 367 | # The object file name does not affect the name of the '.d' file. 368 | # pgcc 10.2 will output 369 | # foo.o: sub/foo.c sub/foo.h 370 | # and will wrap long lines using '\' : 371 | # foo.o: sub/foo.c ... \ 372 | # sub/foo.h ... \ 373 | # ... 374 | set_dir_from "$object" 375 | # Use the source, not the object, to determine the base name, since 376 | # that's sadly what pgcc will do too. 377 | set_base_from "$source" 378 | tmpdepfile=$base.d 379 | 380 | # For projects that build the same source file twice into different object 381 | # files, the pgcc approach of using the *source* file root name can cause 382 | # problems in parallel builds. Use a locking strategy to avoid stomping on 383 | # the same $tmpdepfile. 384 | lockdir=$base.d-lock 385 | trap " 386 | echo '$0: caught signal, cleaning up...' >&2 387 | rmdir '$lockdir' 388 | exit 1 389 | " 1 2 13 15 390 | numtries=100 391 | i=$numtries 392 | while test $i -gt 0; do 393 | # mkdir is a portable test-and-set. 394 | if mkdir "$lockdir" 2>/dev/null; then 395 | # This process acquired the lock. 396 | "$@" -MD 397 | stat=$? 398 | # Release the lock. 399 | rmdir "$lockdir" 400 | break 401 | else 402 | # If the lock is being held by a different process, wait 403 | # until the winning process is done or we timeout. 404 | while test -d "$lockdir" && test $i -gt 0; do 405 | sleep 1 406 | i=`expr $i - 1` 407 | done 408 | fi 409 | i=`expr $i - 1` 410 | done 411 | trap - 1 2 13 15 412 | if test $i -le 0; then 413 | echo "$0: failed to acquire lock after $numtries attempts" >&2 414 | echo "$0: check lockdir '$lockdir'" >&2 415 | exit 1 416 | fi 417 | 418 | if test $stat -ne 0; then 419 | rm -f "$tmpdepfile" 420 | exit $stat 421 | fi 422 | rm -f "$depfile" 423 | # Each line is of the form `foo.o: dependent.h', 424 | # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. 425 | # Do two passes, one to just change these to 426 | # `$object: dependent.h' and one to simply `dependent.h:'. 427 | sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" 428 | # Some versions of the HPUX 10.20 sed can't process this invocation 429 | # correctly. Breaking it into two sed invocations is a workaround. 430 | sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ 431 | | sed -e 's/$/ :/' >> "$depfile" 432 | rm -f "$tmpdepfile" 433 | ;; 434 | 435 | hp2) 436 | # The "hp" stanza above does not work with aCC (C++) and HP's ia64 437 | # compilers, which have integrated preprocessors. The correct option 438 | # to use with these is +Maked; it writes dependencies to a file named 439 | # 'foo.d', which lands next to the object file, wherever that 440 | # happens to be. 441 | # Much of this is similar to the tru64 case; see comments there. 442 | set_dir_from "$object" 443 | set_base_from "$object" 444 | if test "$libtool" = yes; then 445 | tmpdepfile1=$dir$base.d 446 | tmpdepfile2=$dir.libs/$base.d 447 | "$@" -Wc,+Maked 448 | else 449 | tmpdepfile1=$dir$base.d 450 | tmpdepfile2=$dir$base.d 451 | "$@" +Maked 452 | fi 453 | stat=$? 454 | if test $stat -ne 0; then 455 | rm -f "$tmpdepfile1" "$tmpdepfile2" 456 | exit $stat 457 | fi 458 | 459 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" 460 | do 461 | test -f "$tmpdepfile" && break 462 | done 463 | if test -f "$tmpdepfile"; then 464 | sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" 465 | # Add 'dependent.h:' lines. 466 | sed -ne '2,${ 467 | s/^ *// 468 | s/ \\*$// 469 | s/$/:/ 470 | p 471 | }' "$tmpdepfile" >> "$depfile" 472 | else 473 | make_dummy_depfile 474 | fi 475 | rm -f "$tmpdepfile" "$tmpdepfile2" 476 | ;; 477 | 478 | tru64) 479 | # The Tru64 compiler uses -MD to generate dependencies as a side 480 | # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. 481 | # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 482 | # dependencies in 'foo.d' instead, so we check for that too. 483 | # Subdirectories are respected. 484 | set_dir_from "$object" 485 | set_base_from "$object" 486 | 487 | if test "$libtool" = yes; then 488 | # Libtool generates 2 separate objects for the 2 libraries. These 489 | # two compilations output dependencies in $dir.libs/$base.o.d and 490 | # in $dir$base.o.d. We have to check for both files, because 491 | # one of the two compilations can be disabled. We should prefer 492 | # $dir$base.o.d over $dir.libs/$base.o.d because the latter is 493 | # automatically cleaned when .libs/ is deleted, while ignoring 494 | # the former would cause a distcleancheck panic. 495 | tmpdepfile1=$dir$base.o.d # libtool 1.5 496 | tmpdepfile2=$dir.libs/$base.o.d # Likewise. 497 | tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 498 | "$@" -Wc,-MD 499 | else 500 | tmpdepfile1=$dir$base.d 501 | tmpdepfile2=$dir$base.d 502 | tmpdepfile3=$dir$base.d 503 | "$@" -MD 504 | fi 505 | 506 | stat=$? 507 | if test $stat -ne 0; then 508 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 509 | exit $stat 510 | fi 511 | 512 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 513 | do 514 | test -f "$tmpdepfile" && break 515 | done 516 | # Same post-processing that is required for AIX mode. 517 | aix_post_process_depfile 518 | ;; 519 | 520 | msvc7) 521 | if test "$libtool" = yes; then 522 | showIncludes=-Wc,-showIncludes 523 | else 524 | showIncludes=-showIncludes 525 | fi 526 | "$@" $showIncludes > "$tmpdepfile" 527 | stat=$? 528 | grep -v '^Note: including file: ' "$tmpdepfile" 529 | if test $stat -ne 0; then 530 | rm -f "$tmpdepfile" 531 | exit $stat 532 | fi 533 | rm -f "$depfile" 534 | echo "$object : \\" > "$depfile" 535 | # The first sed program below extracts the file names and escapes 536 | # backslashes for cygpath. The second sed program outputs the file 537 | # name when reading, but also accumulates all include files in the 538 | # hold buffer in order to output them again at the end. This only 539 | # works with sed implementations that can handle large buffers. 540 | sed < "$tmpdepfile" -n ' 541 | /^Note: including file: *\(.*\)/ { 542 | s//\1/ 543 | s/\\/\\\\/g 544 | p 545 | }' | $cygpath_u | sort -u | sed -n ' 546 | s/ /\\ /g 547 | s/\(.*\)/'"$tab"'\1 \\/p 548 | s/.\(.*\) \\/\1:/ 549 | H 550 | $ { 551 | s/.*/'"$tab"'/ 552 | G 553 | p 554 | }' >> "$depfile" 555 | echo >> "$depfile" # make sure the fragment doesn't end with a backslash 556 | rm -f "$tmpdepfile" 557 | ;; 558 | 559 | msvc7msys) 560 | # This case exists only to let depend.m4 do its work. It works by 561 | # looking at the text of this script. This case will never be run, 562 | # since it is checked for above. 563 | exit 1 564 | ;; 565 | 566 | #nosideeffect) 567 | # This comment above is used by automake to tell side-effect 568 | # dependency tracking mechanisms from slower ones. 569 | 570 | dashmstdout) 571 | # Important note: in order to support this mode, a compiler *must* 572 | # always write the preprocessed file to stdout, regardless of -o. 573 | "$@" || exit $? 574 | 575 | # Remove the call to Libtool. 576 | if test "$libtool" = yes; then 577 | while test "X$1" != 'X--mode=compile'; do 578 | shift 579 | done 580 | shift 581 | fi 582 | 583 | # Remove '-o $object'. 584 | IFS=" " 585 | for arg 586 | do 587 | case $arg in 588 | -o) 589 | shift 590 | ;; 591 | $object) 592 | shift 593 | ;; 594 | *) 595 | set fnord "$@" "$arg" 596 | shift # fnord 597 | shift # $arg 598 | ;; 599 | esac 600 | done 601 | 602 | test -z "$dashmflag" && dashmflag=-M 603 | # Require at least two characters before searching for ':' 604 | # in the target name. This is to cope with DOS-style filenames: 605 | # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. 606 | "$@" $dashmflag | 607 | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" 608 | rm -f "$depfile" 609 | cat < "$tmpdepfile" > "$depfile" 610 | # Some versions of the HPUX 10.20 sed can't process this sed invocation 611 | # correctly. Breaking it into two sed invocations is a workaround. 612 | tr ' ' "$nl" < "$tmpdepfile" \ 613 | | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ 614 | | sed -e 's/$/ :/' >> "$depfile" 615 | rm -f "$tmpdepfile" 616 | ;; 617 | 618 | dashXmstdout) 619 | # This case only exists to satisfy depend.m4. It is never actually 620 | # run, as this mode is specially recognized in the preamble. 621 | exit 1 622 | ;; 623 | 624 | makedepend) 625 | "$@" || exit $? 626 | # Remove any Libtool call 627 | if test "$libtool" = yes; then 628 | while test "X$1" != 'X--mode=compile'; do 629 | shift 630 | done 631 | shift 632 | fi 633 | # X makedepend 634 | shift 635 | cleared=no eat=no 636 | for arg 637 | do 638 | case $cleared in 639 | no) 640 | set ""; shift 641 | cleared=yes ;; 642 | esac 643 | if test $eat = yes; then 644 | eat=no 645 | continue 646 | fi 647 | case "$arg" in 648 | -D*|-I*) 649 | set fnord "$@" "$arg"; shift ;; 650 | # Strip any option that makedepend may not understand. Remove 651 | # the object too, otherwise makedepend will parse it as a source file. 652 | -arch) 653 | eat=yes ;; 654 | -*|$object) 655 | ;; 656 | *) 657 | set fnord "$@" "$arg"; shift ;; 658 | esac 659 | done 660 | obj_suffix=`echo "$object" | sed 's/^.*\././'` 661 | touch "$tmpdepfile" 662 | ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" 663 | rm -f "$depfile" 664 | # makedepend may prepend the VPATH from the source file name to the object. 665 | # No need to regex-escape $object, excess matching of '.' is harmless. 666 | sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" 667 | # Some versions of the HPUX 10.20 sed can't process the last invocation 668 | # correctly. Breaking it into two sed invocations is a workaround. 669 | sed '1,2d' "$tmpdepfile" \ 670 | | tr ' ' "$nl" \ 671 | | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ 672 | | sed -e 's/$/ :/' >> "$depfile" 673 | rm -f "$tmpdepfile" "$tmpdepfile".bak 674 | ;; 675 | 676 | cpp) 677 | # Important note: in order to support this mode, a compiler *must* 678 | # always write the preprocessed file to stdout. 679 | "$@" || exit $? 680 | 681 | # Remove the call to Libtool. 682 | if test "$libtool" = yes; then 683 | while test "X$1" != 'X--mode=compile'; do 684 | shift 685 | done 686 | shift 687 | fi 688 | 689 | # Remove '-o $object'. 690 | IFS=" " 691 | for arg 692 | do 693 | case $arg in 694 | -o) 695 | shift 696 | ;; 697 | $object) 698 | shift 699 | ;; 700 | *) 701 | set fnord "$@" "$arg" 702 | shift # fnord 703 | shift # $arg 704 | ;; 705 | esac 706 | done 707 | 708 | "$@" -E \ 709 | | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 710 | -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 711 | | sed '$ s: \\$::' > "$tmpdepfile" 712 | rm -f "$depfile" 713 | echo "$object : \\" > "$depfile" 714 | cat < "$tmpdepfile" >> "$depfile" 715 | sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" 716 | rm -f "$tmpdepfile" 717 | ;; 718 | 719 | msvisualcpp) 720 | # Important note: in order to support this mode, a compiler *must* 721 | # always write the preprocessed file to stdout. 722 | "$@" || exit $? 723 | 724 | # Remove the call to Libtool. 725 | if test "$libtool" = yes; then 726 | while test "X$1" != 'X--mode=compile'; do 727 | shift 728 | done 729 | shift 730 | fi 731 | 732 | IFS=" " 733 | for arg 734 | do 735 | case "$arg" in 736 | -o) 737 | shift 738 | ;; 739 | $object) 740 | shift 741 | ;; 742 | "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") 743 | set fnord "$@" 744 | shift 745 | shift 746 | ;; 747 | *) 748 | set fnord "$@" "$arg" 749 | shift 750 | shift 751 | ;; 752 | esac 753 | done 754 | "$@" -E 2>/dev/null | 755 | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" 756 | rm -f "$depfile" 757 | echo "$object : \\" > "$depfile" 758 | sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" 759 | echo "$tab" >> "$depfile" 760 | sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" 761 | rm -f "$tmpdepfile" 762 | ;; 763 | 764 | msvcmsys) 765 | # This case exists only to let depend.m4 do its work. It works by 766 | # looking at the text of this script. This case will never be run, 767 | # since it is checked for above. 768 | exit 1 769 | ;; 770 | 771 | none) 772 | exec "$@" 773 | ;; 774 | 775 | *) 776 | echo "Unknown depmode $depmode" 1>&2 777 | exit 1 778 | ;; 779 | esac 780 | 781 | exit 0 782 | 783 | # Local Variables: 784 | # mode: shell-script 785 | # sh-indentation: 2 786 | # eval: (add-hook 'write-file-hooks 'time-stamp) 787 | # time-stamp-start: "scriptversion=" 788 | # time-stamp-format: "%:y-%02m-%02d.%02H" 789 | # time-stamp-time-zone: "UTC" 790 | # time-stamp-end: "; # UTC" 791 | # End: 792 | -------------------------------------------------------------------------------- /device.c: -------------------------------------------------------------------------------- 1 | 2 | #include "common.h" 3 | #include 4 | #include /* getopt */ 5 | #include /* isprint */ 6 | 7 | int DDRtoDevice(unsigned char *buf,unsigned int len) 8 | { 9 | 10 | unsigned int ack=0; 11 | AUTOTYPEHEAD head; 12 | head.address=DDRADDRESS; 13 | head.filelen=len; 14 | MSG_DEBUG("head.address=0x%08x,head.filelen=%d\n",head.address,head.filelen); 15 | NUC_WritePipe(0,(unsigned char*)&head,sizeof(AUTOTYPEHEAD)); 16 | NUC_WritePipe(0,(unsigned char *)buf,len); 17 | NUC_ReadPipe(0,(unsigned char *)&ack,(int)sizeof(unsigned int)); 18 | if(ack==(BUF_SIZE+1)) return RUN_ON_XUSB; 19 | NUC_ReadPipe(0,(unsigned char *)&ack,(int)sizeof(unsigned int)); 20 | if(ack!=0x55AA55AA) return -1; 21 | MSG_DEBUG("ack=0x%08x\n",ack); 22 | return 0; 23 | } 24 | 25 | int XUSBtoDevice(unsigned char *buf,unsigned int len) 26 | { 27 | unsigned char SIGNATURE[]= {'W','B',0x5A,0xA5}; 28 | AUTOTYPEHEAD fhead; 29 | XBINHEAD *xbinhead; 30 | unsigned int scnt,rcnt,file_len,ack,total; 31 | unsigned char *pbuf; 32 | int bResult,pos; 33 | xbinhead=(XBINHEAD *)buf; 34 | pbuf=buf+sizeof(XBINHEAD); 35 | file_len=len-sizeof(XBINHEAD); 36 | fhead.filelen = file_len; 37 | if(xbinhead->sign==*(unsigned int *)SIGNATURE) { 38 | MSG_DEBUG("passed xbinhead->address=%x\n",xbinhead->address); 39 | fhead.address = xbinhead->address;//0x8000; 40 | } else { 41 | fhead.address = 0xFFFFFFFF; 42 | } 43 | if(fhead.address==0xFFFFFFFF) { 44 | return -1; 45 | } 46 | NUC_WritePipe(0,(unsigned char*)&fhead,sizeof(AUTOTYPEHEAD)); 47 | scnt=file_len/BUF_SIZE; 48 | rcnt=file_len%BUF_SIZE; 49 | total=0; 50 | while(scnt>0) { 51 | bResult=NUC_WritePipe(0,(unsigned char*)pbuf,BUF_SIZE); 52 | if(bResult<0) return -1; 53 | pbuf+=BUF_SIZE; 54 | total+=BUF_SIZE; 55 | pos=(int)(((float)(((float)total/(float)file_len))*100)); 56 | bResult=NUC_ReadPipe(0,(UCHAR *)&ack,4); 57 | if(bResult<0 || ack!=BUF_SIZE) { 58 | return -1; 59 | } 60 | scnt--; 61 | } 62 | if(rcnt>0) { 63 | bResult=NUC_WritePipe(0,(unsigned char*)pbuf,rcnt); 64 | if(bResult<0) return -1; 65 | total+=rcnt; 66 | bResult=NUC_ReadPipe(0,(UCHAR *)&ack,4); 67 | if(bResult<0 || ack!=rcnt) return -1; 68 | } 69 | return 0; 70 | 71 | } 72 | 73 | 74 | /* 75 | typedef struct _INFO_T { 76 | DWORD Nand_uPagePerBlock; 77 | DWORD Nand_uPageSize; 78 | DWORD Nand_uSectorPerBlock; 79 | DWORD Nand_uBlockPerFlash; 80 | DWORD Nand_uBadBlockCount; 81 | DWORD Nand_uSpareSize; 82 | DWORD SPI_ID; 83 | DWORD EMMC_uBlock; 84 | DWORD EMMC_uReserved; 85 | DWORD MTP_uNumber; 86 | } INFO_T,*PINFO_T; 87 | */ 88 | int InfoFromDevice(void) 89 | { 90 | int bResult; 91 | if(NUC_OpenUsb()<0) return -1; 92 | NUC_SetType(0,INFO); 93 | 94 | m_info.Nand_uPagePerBlock = 0;//Nand_uPagePerBlock; 95 | m_info.Nand_uBlockPerFlash = 0;//Nand_uBlockPerFlash; 96 | 97 | m_info.Nand_uPagePerBlock = 0; 98 | m_info.Nand_uBlockPerFlash = 0; 99 | bResult=NUC_WritePipe(0,(UCHAR *)&m_info, sizeof(INFO_T)); 100 | if(bResult<0) goto EXIT; 101 | bResult=NUC_ReadPipe(0,(UCHAR *)&m_info, sizeof(INFO_T)); 102 | if(bResult<0) goto EXIT; 103 | 104 | MSG_DEBUG("Nand_uPagePerBlock=%d\n",m_info.Nand_uPagePerBlock); 105 | MSG_DEBUG("Nand_uPageSize=%d\n",m_info.Nand_uPageSize); 106 | MSG_DEBUG("Nand_uSectorPerBlock=%d\n",m_info.Nand_uSectorPerBlock); 107 | MSG_DEBUG("Nand_uBlockPerFlash=%d\n",m_info.Nand_uBlockPerFlash); 108 | MSG_DEBUG("Nand_uBadBlockCount=%d\n",m_info.Nand_uBadBlockCount); 109 | return 0; 110 | EXIT: 111 | 112 | return -1; 113 | } 114 | 115 | #if 0 116 | int main(int argc, char **argv) 117 | { 118 | 119 | int r,dlen,xlen; 120 | int i; 121 | unsigned int *p32; 122 | unsigned char *dbuf,*xbuf; 123 | libusb_init(&ctx); 124 | 125 | //Open Device with VendorID and ProductID 126 | handle = libusb_open_device_with_vid_pid(ctx, 127 | USB_VENDOR_ID, USB_PRODUCT_ID); 128 | if (!handle) { 129 | perror("device not found"); 130 | return 1; 131 | } 132 | 133 | r = libusb_claim_interface(handle, 0); 134 | if (r < 0) { 135 | fprintf(stderr, "usb_claim_interface error %d\n", r); 136 | return 2; 137 | } 138 | 139 | dbuf=load_ddr("Release/sys_cfg/NUC972DF62Y.ini",&dlen); 140 | if(DDRtoDevice(dbuf,dlen)<0) { 141 | printf("Burn DDR to Device failed\n"); 142 | goto EXIT; 143 | } 144 | xbuf=load_xusb("Release/xusb64.bin",&xlen); 145 | if(XUSBtoDevice(xbuf,xlen)<0) { 146 | printf("Burn XUSB to Device failed\n"); 147 | goto EXIT; 148 | } 149 | 150 | EXIT: 151 | //never reached 152 | libusb_close(handle); 153 | libusb_exit(NULL); 154 | } 155 | #endif 156 | -------------------------------------------------------------------------------- /install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # install - install a program, script, or datafile 3 | 4 | scriptversion=2014-09-12.12; # UTC 5 | 6 | # This originates from X11R5 (mit/util/scripts/install.sh), which was 7 | # later released in X11R6 (xc/config/util/install.sh) with the 8 | # following copyright and license. 9 | # 10 | # Copyright (C) 1994 X Consortium 11 | # 12 | # Permission is hereby granted, free of charge, to any person obtaining a copy 13 | # of this software and associated documentation files (the "Software"), to 14 | # deal in the Software without restriction, including without limitation the 15 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 16 | # sell copies of the Software, and to permit persons to whom the Software is 17 | # furnished to do so, subject to the following conditions: 18 | # 19 | # The above copyright notice and this permission notice shall be included in 20 | # all copies or substantial portions of the Software. 21 | # 22 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26 | # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- 27 | # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name of the X Consortium shall not 30 | # be used in advertising or otherwise to promote the sale, use or other deal- 31 | # ings in this Software without prior written authorization from the X Consor- 32 | # tium. 33 | # 34 | # 35 | # FSF changes to this file are in the public domain. 36 | # 37 | # Calling this script install-sh is preferred over install.sh, to prevent 38 | # 'make' implicit rules from creating a file called install from it 39 | # when there is no Makefile. 40 | # 41 | # This script is compatible with the BSD install script, but was written 42 | # from scratch. 43 | 44 | tab=' ' 45 | nl=' 46 | ' 47 | IFS=" $tab$nl" 48 | 49 | # Set DOITPROG to "echo" to test this script. 50 | 51 | doit=${DOITPROG-} 52 | doit_exec=${doit:-exec} 53 | 54 | # Put in absolute file names if you don't have them in your path; 55 | # or use environment vars. 56 | 57 | chgrpprog=${CHGRPPROG-chgrp} 58 | chmodprog=${CHMODPROG-chmod} 59 | chownprog=${CHOWNPROG-chown} 60 | cmpprog=${CMPPROG-cmp} 61 | cpprog=${CPPROG-cp} 62 | mkdirprog=${MKDIRPROG-mkdir} 63 | mvprog=${MVPROG-mv} 64 | rmprog=${RMPROG-rm} 65 | stripprog=${STRIPPROG-strip} 66 | 67 | posix_mkdir= 68 | 69 | # Desired mode of installed file. 70 | mode=0755 71 | 72 | chgrpcmd= 73 | chmodcmd=$chmodprog 74 | chowncmd= 75 | mvcmd=$mvprog 76 | rmcmd="$rmprog -f" 77 | stripcmd= 78 | 79 | src= 80 | dst= 81 | dir_arg= 82 | dst_arg= 83 | 84 | copy_on_change=false 85 | is_target_a_directory=possibly 86 | 87 | usage="\ 88 | Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE 89 | or: $0 [OPTION]... SRCFILES... DIRECTORY 90 | or: $0 [OPTION]... -t DIRECTORY SRCFILES... 91 | or: $0 [OPTION]... -d DIRECTORIES... 92 | 93 | In the 1st form, copy SRCFILE to DSTFILE. 94 | In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. 95 | In the 4th, create DIRECTORIES. 96 | 97 | Options: 98 | --help display this help and exit. 99 | --version display version info and exit. 100 | 101 | -c (ignored) 102 | -C install only if different (preserve the last data modification time) 103 | -d create directories instead of installing files. 104 | -g GROUP $chgrpprog installed files to GROUP. 105 | -m MODE $chmodprog installed files to MODE. 106 | -o USER $chownprog installed files to USER. 107 | -s $stripprog installed files. 108 | -t DIRECTORY install into DIRECTORY. 109 | -T report an error if DSTFILE is a directory. 110 | 111 | Environment variables override the default commands: 112 | CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG 113 | RMPROG STRIPPROG 114 | " 115 | 116 | while test $# -ne 0; do 117 | case $1 in 118 | -c) ;; 119 | 120 | -C) copy_on_change=true;; 121 | 122 | -d) dir_arg=true;; 123 | 124 | -g) chgrpcmd="$chgrpprog $2" 125 | shift;; 126 | 127 | --help) echo "$usage"; exit $?;; 128 | 129 | -m) mode=$2 130 | case $mode in 131 | *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) 132 | echo "$0: invalid mode: $mode" >&2 133 | exit 1;; 134 | esac 135 | shift;; 136 | 137 | -o) chowncmd="$chownprog $2" 138 | shift;; 139 | 140 | -s) stripcmd=$stripprog;; 141 | 142 | -t) 143 | is_target_a_directory=always 144 | dst_arg=$2 145 | # Protect names problematic for 'test' and other utilities. 146 | case $dst_arg in 147 | -* | [=\(\)!]) dst_arg=./$dst_arg;; 148 | esac 149 | shift;; 150 | 151 | -T) is_target_a_directory=never;; 152 | 153 | --version) echo "$0 $scriptversion"; exit $?;; 154 | 155 | --) shift 156 | break;; 157 | 158 | -*) echo "$0: invalid option: $1" >&2 159 | exit 1;; 160 | 161 | *) break;; 162 | esac 163 | shift 164 | done 165 | 166 | # We allow the use of options -d and -T together, by making -d 167 | # take the precedence; this is for compatibility with GNU install. 168 | 169 | if test -n "$dir_arg"; then 170 | if test -n "$dst_arg"; then 171 | echo "$0: target directory not allowed when installing a directory." >&2 172 | exit 1 173 | fi 174 | fi 175 | 176 | if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then 177 | # When -d is used, all remaining arguments are directories to create. 178 | # When -t is used, the destination is already specified. 179 | # Otherwise, the last argument is the destination. Remove it from $@. 180 | for arg 181 | do 182 | if test -n "$dst_arg"; then 183 | # $@ is not empty: it contains at least $arg. 184 | set fnord "$@" "$dst_arg" 185 | shift # fnord 186 | fi 187 | shift # arg 188 | dst_arg=$arg 189 | # Protect names problematic for 'test' and other utilities. 190 | case $dst_arg in 191 | -* | [=\(\)!]) dst_arg=./$dst_arg;; 192 | esac 193 | done 194 | fi 195 | 196 | if test $# -eq 0; then 197 | if test -z "$dir_arg"; then 198 | echo "$0: no input file specified." >&2 199 | exit 1 200 | fi 201 | # It's OK to call 'install-sh -d' without argument. 202 | # This can happen when creating conditional directories. 203 | exit 0 204 | fi 205 | 206 | if test -z "$dir_arg"; then 207 | if test $# -gt 1 || test "$is_target_a_directory" = always; then 208 | if test ! -d "$dst_arg"; then 209 | echo "$0: $dst_arg: Is not a directory." >&2 210 | exit 1 211 | fi 212 | fi 213 | fi 214 | 215 | if test -z "$dir_arg"; then 216 | do_exit='(exit $ret); exit $ret' 217 | trap "ret=129; $do_exit" 1 218 | trap "ret=130; $do_exit" 2 219 | trap "ret=141; $do_exit" 13 220 | trap "ret=143; $do_exit" 15 221 | 222 | # Set umask so as not to create temps with too-generous modes. 223 | # However, 'strip' requires both read and write access to temps. 224 | case $mode in 225 | # Optimize common cases. 226 | *644) cp_umask=133;; 227 | *755) cp_umask=22;; 228 | 229 | *[0-7]) 230 | if test -z "$stripcmd"; then 231 | u_plus_rw= 232 | else 233 | u_plus_rw='% 200' 234 | fi 235 | cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; 236 | *) 237 | if test -z "$stripcmd"; then 238 | u_plus_rw= 239 | else 240 | u_plus_rw=,u+rw 241 | fi 242 | cp_umask=$mode$u_plus_rw;; 243 | esac 244 | fi 245 | 246 | for src 247 | do 248 | # Protect names problematic for 'test' and other utilities. 249 | case $src in 250 | -* | [=\(\)!]) src=./$src;; 251 | esac 252 | 253 | if test -n "$dir_arg"; then 254 | dst=$src 255 | dstdir=$dst 256 | test -d "$dstdir" 257 | dstdir_status=$? 258 | else 259 | 260 | # Waiting for this to be detected by the "$cpprog $src $dsttmp" command 261 | # might cause directories to be created, which would be especially bad 262 | # if $src (and thus $dsttmp) contains '*'. 263 | if test ! -f "$src" && test ! -d "$src"; then 264 | echo "$0: $src does not exist." >&2 265 | exit 1 266 | fi 267 | 268 | if test -z "$dst_arg"; then 269 | echo "$0: no destination specified." >&2 270 | exit 1 271 | fi 272 | dst=$dst_arg 273 | 274 | # If destination is a directory, append the input filename; won't work 275 | # if double slashes aren't ignored. 276 | if test -d "$dst"; then 277 | if test "$is_target_a_directory" = never; then 278 | echo "$0: $dst_arg: Is a directory" >&2 279 | exit 1 280 | fi 281 | dstdir=$dst 282 | dst=$dstdir/`basename "$src"` 283 | dstdir_status=0 284 | else 285 | dstdir=`dirname "$dst"` 286 | test -d "$dstdir" 287 | dstdir_status=$? 288 | fi 289 | fi 290 | 291 | obsolete_mkdir_used=false 292 | 293 | if test $dstdir_status != 0; then 294 | case $posix_mkdir in 295 | '') 296 | # Create intermediate dirs using mode 755 as modified by the umask. 297 | # This is like FreeBSD 'install' as of 1997-10-28. 298 | umask=`umask` 299 | case $stripcmd.$umask in 300 | # Optimize common cases. 301 | *[2367][2367]) mkdir_umask=$umask;; 302 | .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; 303 | 304 | *[0-7]) 305 | mkdir_umask=`expr $umask + 22 \ 306 | - $umask % 100 % 40 + $umask % 20 \ 307 | - $umask % 10 % 4 + $umask % 2 308 | `;; 309 | *) mkdir_umask=$umask,go-w;; 310 | esac 311 | 312 | # With -d, create the new directory with the user-specified mode. 313 | # Otherwise, rely on $mkdir_umask. 314 | if test -n "$dir_arg"; then 315 | mkdir_mode=-m$mode 316 | else 317 | mkdir_mode= 318 | fi 319 | 320 | posix_mkdir=false 321 | case $umask in 322 | *[123567][0-7][0-7]) 323 | # POSIX mkdir -p sets u+wx bits regardless of umask, which 324 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. 325 | ;; 326 | *) 327 | # $RANDOM is not portable (e.g. dash); use it when possible to 328 | # lower collision chance 329 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ 330 | trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 331 | 332 | # As "mkdir -p" follows symlinks and we work in /tmp possibly; so 333 | # create the $tmpdir first (and fail if unsuccessful) to make sure 334 | # that nobody tries to guess the $tmpdir name. 335 | if (umask $mkdir_umask && 336 | $mkdirprog $mkdir_mode "$tmpdir" && 337 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 338 | then 339 | if test -z "$dir_arg" || { 340 | # Check for POSIX incompatibilities with -m. 341 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or 342 | # other-writable bit of parent directory when it shouldn't. 343 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. 344 | test_tmpdir="$tmpdir/a" 345 | ls_ld_tmpdir=`ls -ld "$test_tmpdir"` 346 | case $ls_ld_tmpdir in 347 | d????-?r-*) different_mode=700;; 348 | d????-?--*) different_mode=755;; 349 | *) false;; 350 | esac && 351 | $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { 352 | ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` 353 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" 354 | } 355 | } 356 | then posix_mkdir=: 357 | fi 358 | rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 359 | else 360 | # Remove any dirs left behind by ancient mkdir implementations. 361 | rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null 362 | fi 363 | trap '' 0;; 364 | esac;; 365 | esac 366 | 367 | if 368 | $posix_mkdir && ( 369 | umask $mkdir_umask && 370 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" 371 | ) 372 | then : 373 | else 374 | 375 | # The umask is ridiculous, or mkdir does not conform to POSIX, 376 | # or it failed possibly due to a race condition. Create the 377 | # directory the slow way, step by step, checking for races as we go. 378 | 379 | case $dstdir in 380 | /*) prefix='/';; 381 | [-=\(\)!]*) prefix='./';; 382 | *) prefix='';; 383 | esac 384 | 385 | oIFS=$IFS 386 | IFS=/ 387 | set -f 388 | set fnord $dstdir 389 | shift 390 | set +f 391 | IFS=$oIFS 392 | 393 | prefixes= 394 | 395 | for d 396 | do 397 | test X"$d" = X && continue 398 | 399 | prefix=$prefix$d 400 | if test -d "$prefix"; then 401 | prefixes= 402 | else 403 | if $posix_mkdir; then 404 | (umask=$mkdir_umask && 405 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break 406 | # Don't fail if two instances are running concurrently. 407 | test -d "$prefix" || exit 1 408 | else 409 | case $prefix in 410 | *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; 411 | *) qprefix=$prefix;; 412 | esac 413 | prefixes="$prefixes '$qprefix'" 414 | fi 415 | fi 416 | prefix=$prefix/ 417 | done 418 | 419 | if test -n "$prefixes"; then 420 | # Don't fail if two instances are running concurrently. 421 | (umask $mkdir_umask && 422 | eval "\$doit_exec \$mkdirprog $prefixes") || 423 | test -d "$dstdir" || exit 1 424 | obsolete_mkdir_used=true 425 | fi 426 | fi 427 | fi 428 | 429 | if test -n "$dir_arg"; then 430 | { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && 431 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && 432 | { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || 433 | test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 434 | else 435 | 436 | # Make a couple of temp file names in the proper directory. 437 | dsttmp=$dstdir/_inst.$$_ 438 | rmtmp=$dstdir/_rm.$$_ 439 | 440 | # Trap to clean up those temp files at exit. 441 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 442 | 443 | # Copy the file name to the temp name. 444 | (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && 445 | 446 | # and set any options; do chmod last to preserve setuid bits. 447 | # 448 | # If any of these fail, we abort the whole thing. If we want to 449 | # ignore errors from any of these, just make sure not to ignore 450 | # errors from the above "$doit $cpprog $src $dsttmp" command. 451 | # 452 | { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && 453 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && 454 | { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && 455 | { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && 456 | 457 | # If -C, don't bother to copy if it wouldn't change the file. 458 | if $copy_on_change && 459 | old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && 460 | new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && 461 | set -f && 462 | set X $old && old=:$2:$4:$5:$6 && 463 | set X $new && new=:$2:$4:$5:$6 && 464 | set +f && 465 | test "$old" = "$new" && 466 | $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 467 | then 468 | rm -f "$dsttmp" 469 | else 470 | # Rename the file to the real destination. 471 | $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || 472 | 473 | # The rename failed, perhaps because mv can't rename something else 474 | # to itself, or perhaps because mv is so ancient that it does not 475 | # support -f. 476 | { 477 | # Now remove or move aside any old file at destination location. 478 | # We try this two ways since rm can't unlink itself on some 479 | # systems and the destination file might be busy for other 480 | # reasons. In this case, the final cleanup might fail but the new 481 | # file should still install successfully. 482 | { 483 | test ! -f "$dst" || 484 | $doit $rmcmd -f "$dst" 2>/dev/null || 485 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && 486 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } 487 | } || 488 | { echo "$0: cannot unlink or rename $dst" >&2 489 | (exit 1); exit 1 490 | } 491 | } && 492 | 493 | # Now rename the file to the real destination. 494 | $doit $mvcmd "$dsttmp" "$dst" 495 | } 496 | fi || exit 1 497 | 498 | trap '' 0 499 | fi 500 | done 501 | 502 | # Local variables: 503 | # eval: (add-hook 'write-file-hooks 'time-stamp) 504 | # time-stamp-start: "scriptversion=" 505 | # time-stamp-format: "%:y-%02m-%02d.%02H" 506 | # time-stamp-time-zone: "UTC" 507 | # time-stamp-end: "; # UTC" 508 | # End: 509 | -------------------------------------------------------------------------------- /main.c: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include 3 | #include /* getopt */ 4 | #include /* isprint */ 5 | #include 6 | #include "config.h" 7 | 8 | char DDR_fileName[128]; 9 | char write_file[256]; 10 | char read_file[256]; 11 | char Data_Path[256]; 12 | int mode; 13 | int type; 14 | unsigned int exe_addr; 15 | unsigned int dram_run; 16 | unsigned int erase_read_len; 17 | int erase_tag; 18 | int read_tag; 19 | int write_tag; 20 | int verify_tag; 21 | int dtb_tag; 22 | unsigned int dtb_addr; 23 | 24 | struct _INFO_T m_info; 25 | 26 | libusb_context *ctx; 27 | libusb_device_handle *handle; 28 | 29 | unsigned int csg_usb_index; 30 | libusb_device *dev_arr[MAX_DEV]; 31 | unsigned int dev_count; 32 | 33 | int check_strlen(const struct dirent *dir) 34 | { 35 | if(strlen(dir->d_name)>5) 36 | return 1; 37 | else 38 | return 0; 39 | } 40 | 41 | void print_using() 42 | { 43 | fprintf(stderr, "Download:\n"); 44 | fprintf(stderr, " ./nuwriter -m sdram -d NUC972DF62Y.ini -a 0x8000 -w $IMAGE_PATH/kernel_970image\n"); 45 | fprintf(stderr, "Downalod & run:\n"); 46 | fprintf(stderr, " ./nuwriter -m sdram -d NUC972DF62Y.ini -a 0x8000 -w $IMAGE_PATH/kernel_970image -n\n"); 47 | fprintf(stderr, "Download dtb(device tree):\n"); 48 | fprintf(stderr, " ./nuwriter -m sdram -d NUC972DF62Y.ini -a 0x1E00000 -w $IMAGE_PATH/nuc970-evb.dtb\n"); 49 | fprintf(stderr, " ./nuwriter -m sdram -d NUC972DF62Y.ini -a 0x8000 -w $IMAGE_PATH/kernel_970image -n -i 0x1E00000\n"); 50 | fprintf(stderr, "Burn u-boot-spl.bin to NAND:\n"); 51 | fprintf(stderr, " ./nuwriter -m nand -d NUC972DF62Y.ini -t uboot -a 0x200 -w $IMAGE_PATH/nand_uboot_spl.bin -v\n"); 52 | fprintf(stderr, "Burn u-boot.bin to NAND:\n"); 53 | fprintf(stderr, " ./nuwriter -m nand -d NUC972DF62Y.ini -t data -a 0x100000 -w $IMAGE_PATH/nand_uboot.bin -v\n"); 54 | fprintf(stderr, "Burn env.txt to NAND:\n"); 55 | fprintf(stderr, " ./nuwriter -m nand -d NUC972DF62Y.ini -t env -a 0x80000 -w $IMAGE_PATH/nand_env.txt -v\n"); 56 | fprintf(stderr, "Burn linux to NAND:\n"); 57 | fprintf(stderr, " ./nuwriter -m nand -d NUC972DF62Y.ini -t data -a 0x200000 -w $IMAGE_PATH/kernel_970uimage -v\n"); 58 | fprintf(stderr, "Burn Pack image to NAND\n"); 59 | fprintf(stderr, " ./nuwriter -m nand -d NUC972DF62Y.ini -t pack -w $IMAGE_PATH/nand_pack.bin\n"); 60 | fprintf(stderr, "Erase NAND (chip erase):\n"); 61 | fprintf(stderr, " ./nuwriter -m nand -d NUC972DF62Y.ini -e 0xffffffff\n"); 62 | fprintf(stderr, "Erase NAND 10th block to 30th block:\n"); 63 | fprintf(stderr, " ./nuwriter -m nand -d NUC972DF62Y.ini -a 10 -e 20\n"); 64 | fprintf(stderr, "Read NAND 10th block to 30th block:\n"); 65 | fprintf(stderr, " ./nuwriter -m nand -d NUC972DF62Y.ini -a 10 -e 1 -r $IMAGE_PATH/test.bin\n"); 66 | fprintf(stderr, "Burn u-boot.bin to SPI:\n"); 67 | fprintf(stderr, " ./nuwriter -m spi -d NUC972DF62Y.ini -t uboot -a 0xE00000 -w $IMAGE_PATH/spi_uboot.bin -v\n"); 68 | fprintf(stderr, "Burn env.txt to SPI:\n"); 69 | fprintf(stderr, " ./nuwriter -m spi -d NUC972DF62Y.ini -t env -a 0x80000 -w $IMAGE_PATH/spi_env.txt -v\n"); 70 | fprintf(stderr, "Burn linux to SPI:\n"); 71 | fprintf(stderr, " ./nuwriter -m spi -d NUC972DF62Y.ini -t data -a 0x200000 -w $IMAGE_PATH/kernel_970uimage -v\n"); 72 | fprintf(stderr, "Burn Pack image to SPI\n"); 73 | fprintf(stderr, " ./nuwriter -m spi -d NUC972DF62Y.ini -t pack -w $IMAGE_PATH/spi_pack.bin\n"); 74 | fprintf(stderr, "Erase SPI (chip erase):\n"); 75 | fprintf(stderr, " ./nuwriter -m spi -d NUC972DF62Y.ini -e 0xffffffff\n"); 76 | fprintf(stderr, "Erase SPI 10th block to 30th block:\n"); 77 | fprintf(stderr, " ./nuwriter -m spi -d NUC972DF62Y.ini -a 10 -e 20\n"); 78 | fprintf(stderr, "Read SPI 10th block to 30th block:\n"); 79 | fprintf(stderr, " ./nuwriter -m spi -d NUC972DF62Y.ini -a 10 -e 20 -r $IMAGE_PATH/test.bin\n"); 80 | fprintf(stderr, "Burn u-boot.bin to eMMC:\n"); 81 | fprintf(stderr, " ./nuwriter -m emmc -d NUC972DF62Y.ini -t uboot -a 0xE00000 -w $IMAGE_PATH/emmc_uboot.bin -v\n"); 82 | fprintf(stderr, "Burn env.txt to eMMC:\n"); 83 | fprintf(stderr, " ./nuwriter -m emmc -d NUC972DF62Y.ini -t env -a 0x80000 -w $IMAGE_PATH/emmc_env.txt -v\n"); 84 | fprintf(stderr, "Burn linux to eMMC:\n"); 85 | fprintf(stderr, " ./nuwriter -m emmc -d NUC972DF62Y.ini -t data -a 0x200000 -w $IMAGE_PATH/kernel_970uimage -v\n"); 86 | fprintf(stderr, "Burn Pack image to eMMC\n"); 87 | fprintf(stderr, " ./nuwriter -m emmc -d NUC972DF62Y.ini -t pack -w $IMAGE_PATH/emmc_pack.bin\n"); 88 | fprintf(stderr, "Erase eMMC 10th block to 30th block:\n"); 89 | fprintf(stderr, " ./nuwriter -m emmc -d NUC972DF62Y.ini -a 10 -e 20\n"); 90 | fprintf(stderr, "Read eMMC 10th block to 30th block:\n"); 91 | fprintf(stderr, " ./nuwriter -m emmc -d NUC972DF62Y.ini -a 10 -e 1 -r $IMAGE_PATH/test.bin\n"); 92 | } 93 | int main(int argc, char **argv) 94 | { 95 | 96 | /* Initial */ 97 | char *path; 98 | type = -1; 99 | DDR_fileName[0]='\0'; 100 | exe_addr=0xffffffff; 101 | dram_run = 0; 102 | erase_tag = 0; 103 | write_tag= 0; 104 | read_tag = 0; 105 | verify_tag = 0; 106 | dtb_tag = 0; 107 | int cmd_opt = 0; 108 | int n; 109 | 110 | csg_usb_index = 1; 111 | 112 | #ifndef _WIN32 113 | 114 | n = readlink("/proc/self/exe", Data_Path, sizeof(Data_Path) - 1); 115 | if((n < 0) || (n > (sizeof(Data_Path) - 50))) { 116 | fprintf(stderr, "Link Error!\n"); 117 | return -1; 118 | } 119 | 120 | Data_Path[n] = '\0'; 121 | path = strrchr(Data_Path, '/'); 122 | if(path == NULL) { 123 | fprintf(stderr, "Data Path Error!\n"); 124 | return -2; 125 | } 126 | 127 | path[1] = '\0'; 128 | strcat(Data_Path,"../share/nudata"); 129 | #else 130 | n = snprintf(Data_Path, sizeof(Data_Path), argv[0])); 131 | if(n > (sizeof(Data_Path) - 50)) { 132 | fprintf(stderr, "Data Path Too Long!\n"); 133 | return -2; 134 | } 135 | 136 | path=strrchr(Data_Path,'/'); 137 | if(path == NULL) { 138 | if(getcwd(Data_Path, sizeof(Data_Path) - 50)) == NULL) { 139 | fprintf(stderr, "Data Path Error!\n"); 140 | return errno; 141 | } 142 | } else { 143 | *path='\0'; 144 | } 145 | 146 | strcat(Data_Path, "/nudata"); 147 | #endif 148 | //fprintf(stderr,"Data_Path=%s\n",Data_Path); 149 | //fprintf(stderr, "argc:%d\n", argc); 150 | while(1) { 151 | //fprintf(stderr, "proces index:%d\n", optind); 152 | cmd_opt = getopt(argc, argv, "a:d:e:i:nvhw:r:t:m:z::c::"); 153 | /* End condition always first */ 154 | if (cmd_opt == -1) { 155 | break; 156 | } 157 | 158 | /* Lets parse */ 159 | switch (cmd_opt) { 160 | /* No args */ 161 | case 'h': 162 | fprintf(stderr, "============================================\n"); 163 | fprintf(stderr, "== Nuvoton NuWriter Command Tool V%s ==\n",PACKAGE_VERSION); 164 | fprintf(stderr, "============================================\n"); 165 | 166 | fprintf(stderr, "NuWriter [Options] [File/Value]\n\n"); 167 | fprintf(stderr, "-d [File] Set DDR initial file\n"); 168 | #if 0 169 | fprintf(stderr, "-c [id] Set device number,default 1\n"); 170 | #endif 171 | #ifndef _WIN32 172 | fprintf(stderr, "-d show Print supported DDR model\n"); 173 | #endif 174 | fprintf(stderr, "\n"); 175 | fprintf(stderr, "-m sdram Set SDRAM Mode\n"); 176 | fprintf(stderr, "-m emmc Set eMMC Mode\n"); 177 | fprintf(stderr, "-m nand Set NAND Mode\n"); 178 | fprintf(stderr, "-m spi Set SPI Mode\n"); 179 | fprintf(stderr, "\n"); 180 | fprintf(stderr, "-t data Set DATA Type\n"); 181 | fprintf(stderr, "-t env Set Environemnt Type\n"); 182 | fprintf(stderr, "-t uboot Set uBoot Type\n"); 183 | fprintf(stderr, "-t pack Set PACK Type\n"); 184 | fprintf(stderr, "SDRAM parameters:\n"); 185 | fprintf(stderr, "-a [value] Set execute address\n"); 186 | fprintf(stderr, "-w [File] Write image file to SDRAM\n"); 187 | fprintf(stderr, "-i [value] device tree address\n"); 188 | fprintf(stderr, "-n Download & Run\n"); 189 | fprintf(stderr, "\n"); 190 | fprintf(stderr, "NAND/SPI/eMMC parameters:\n"); 191 | fprintf(stderr, "-a [value] Set start offset/execute address\n"); 192 | fprintf(stderr, " if erase, unit of block\n"); 193 | fprintf(stderr, "-w [File] Write image file to NAND\n"); 194 | fprintf(stderr, "-r [File] Read image file from NAND\n"); 195 | fprintf(stderr, "-e [value] Read/Erase length(unit of block)\n"); 196 | fprintf(stderr, "-e 0xFFFFFFFF Chip erase\n"); 197 | fprintf(stderr, "-v Verify image file after Write image \n"); 198 | fprintf(stderr, "\n============================================\n"); 199 | return 0; 200 | case 'n': 201 | dram_run = 1; 202 | break; 203 | 204 | /* Single arg */ 205 | case 'a': 206 | exe_addr=strtoul(optarg,NULL,0); 207 | break; 208 | case 'd': { 209 | char dir_path[256]; 210 | sprintf(dir_path,"%s%s",Data_Path,"/sys_cfg"); 211 | #ifndef _WIN32 212 | if(strcasecmp(optarg,"show")==0) { 213 | struct dirent **namelist; 214 | int i, total; 215 | total = scandir(dir_path,&namelist,check_strlen,0); 216 | for(i=0; id_name); 218 | return 0; 219 | } else { 220 | strcpy(DDR_fileName,optarg); 221 | //fprintf(stderr,"DDR_fileName=%s\n",DDR_fileName); 222 | } 223 | #else 224 | strcpy(DDR_fileName,optarg); 225 | #endif 226 | } 227 | break; 228 | case 'i': 229 | dtb_tag=1; 230 | dtb_addr=strtoul(optarg,NULL,0); 231 | break; 232 | case 'w': 233 | write_tag=1; 234 | strcpy(write_file,optarg); 235 | break; 236 | case 'r': 237 | read_tag=1; 238 | strcpy(read_file,optarg); 239 | break; 240 | case 'v': 241 | verify_tag=1; 242 | break; 243 | case 'm': 244 | if(strcasecmp(optarg,"sdram")==0) { 245 | //fprintf(stderr,"SDRAM mode\n"); 246 | mode=SDRAM_M; 247 | } else if(strcasecmp(optarg,"emmc")==0) { 248 | //fprintf(stderr,"eMMC mode\n"); 249 | mode=EMMC_M; 250 | } else if(strcasecmp(optarg,"nand")==0) { 251 | //fprintf(stderr,"NAND mode\n"); 252 | mode=NAND_M; 253 | } else if(strcasecmp(optarg,"spi")==0) { 254 | //fprintf(stderr,"SPI mode\n"); 255 | mode=SPI_M; 256 | } else { 257 | fprintf(stderr,"Unknown mode\n"); 258 | } 259 | break; 260 | 261 | case 't': 262 | if(strcasecmp(optarg,"data")==0) { 263 | //fprintf(stderr,"DATA type\n"); 264 | type=DATA; 265 | } else if(strcasecmp(optarg,"env")==0) { 266 | //fprintf(stderr,"Environment type\n"); 267 | type=ENV; 268 | } else if(strcasecmp(optarg,"uboot")==0) { 269 | //fprintf(stderr,"uBoot type\n"); 270 | type=UBOOT; 271 | } else if(strcasecmp(optarg,"pack")==0) { 272 | //fprintf(stderr,"Pack type\n"); 273 | type=PACK; 274 | } else { 275 | fprintf(stderr,"Unknown type\n"); 276 | } 277 | break; 278 | case 'e': 279 | erase_tag = 1; 280 | erase_read_len=strtoul(optarg,NULL,0); 281 | break; 282 | /* Optional args */ 283 | case 'z': 284 | print_using(); 285 | return 0; 286 | break; 287 | #if 0 288 | case 'c': 289 | 290 | csg_usb_index = atoi(argv[optind]); 291 | break; 292 | #endif 293 | 294 | /* Error handle: Mainly missing arg or illegal option */ 295 | case '?': 296 | fprintf(stderr, "Illegal option:-%c\n", isprint(optopt)?optopt:'#'); 297 | break; 298 | default: 299 | fprintf(stderr, "Not supported option\n"); 300 | fprintf(stderr, "Try 'nuwriter -h' for more information.\n"); 301 | break; 302 | } 303 | } 304 | 305 | if(strlen(DDR_fileName)==0) { 306 | fprintf(stderr, "Not setting DDR file\n"); 307 | return -1; 308 | } 309 | if(mode==-1) { 310 | fprintf(stderr, "Not setting mode\n"); 311 | return -1; 312 | } 313 | 314 | if(mode==SDRAM_M) { 315 | if(exe_addr==0xffffffff) { 316 | fprintf(stderr, "Not setting execute/download address(-a [Address])\n"); 317 | return -1; 318 | } 319 | if(strlen(write_file)==0) { 320 | fprintf(stderr, "Not setting DDR file(-m [DDR])\n"); 321 | return -1; 322 | } 323 | 324 | } 325 | 326 | if((mode==NAND_M || mode==SPI_M || mode==EMMC_M) && type!=PACK) { 327 | if(write_tag==1 && read_tag==1) { 328 | fprintf(stderr, "Cannot write & read Nand flash at same time\n"); 329 | return -1; 330 | } 331 | 332 | if(read_tag==1) { 333 | 334 | if(exe_addr==0xffffffff) { 335 | fprintf(stderr, "Not setting start address(-a [value])\n"); 336 | return -1; 337 | } 338 | if(erase_tag!=1) { 339 | fprintf(stderr, "Not setting length(-e [value])\n"); 340 | return -1; 341 | } 342 | erase_tag=0; 343 | } 344 | 345 | if(write_tag==1) { 346 | if(exe_addr==0xffffffff) { 347 | fprintf(stderr, "Not setting start address(-a [value])\n"); 348 | return -1; 349 | } 350 | if(strlen(write_file)==0 && strlen(write_file)==0) { 351 | fprintf(stderr,"Not setting read/write file(-w [file])\n"); 352 | return -1; 353 | } 354 | if(type==-1 && strlen(write_file)!=0) { 355 | fprintf(stderr, "Not setting type(-t [type])\n"); 356 | return -1; 357 | } 358 | } 359 | } 360 | 361 | if(type==PACK) { 362 | if(verify_tag==1) 363 | fprintf(stderr, "Pack cannot supported verify (-v)\n"); 364 | } 365 | 366 | libusb_init(NULL); 367 | if((dev_count=get_device_num_with_vid_pid(ctx,USB_VENDOR_ID, USB_PRODUCT_ID))==0) { 368 | printf("Device not found\n"); 369 | libusb_exit(NULL); 370 | return -1; 371 | } 372 | 373 | if(ParseFlashType()< 0) { 374 | printf("Failed\n"); 375 | NUC_CloseUsb(); 376 | libusb_exit(NULL); 377 | return -1; 378 | } 379 | NUC_CloseUsb(); 380 | libusb_exit(NULL); 381 | return 0; 382 | } 383 | -------------------------------------------------------------------------------- /missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common wrapper for a few potentially missing GNU programs. 3 | 4 | scriptversion=2013-10-28.13; # UTC 5 | 6 | # Copyright (C) 1996-2014 Free Software Foundation, Inc. 7 | # Originally written by Fran,cois Pinard , 1996. 8 | 9 | # This program is free software; you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 2, or (at your option) 12 | # any later version. 13 | 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | if test $# -eq 0; then 28 | echo 1>&2 "Try '$0 --help' for more information" 29 | exit 1 30 | fi 31 | 32 | case $1 in 33 | 34 | --is-lightweight) 35 | # Used by our autoconf macros to check whether the available missing 36 | # script is modern enough. 37 | exit 0 38 | ;; 39 | 40 | --run) 41 | # Back-compat with the calling convention used by older automake. 42 | shift 43 | ;; 44 | 45 | -h|--h|--he|--hel|--help) 46 | echo "\ 47 | $0 [OPTION]... PROGRAM [ARGUMENT]... 48 | 49 | Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due 50 | to PROGRAM being missing or too old. 51 | 52 | Options: 53 | -h, --help display this help and exit 54 | -v, --version output version information and exit 55 | 56 | Supported PROGRAM values: 57 | aclocal autoconf autoheader autom4te automake makeinfo 58 | bison yacc flex lex help2man 59 | 60 | Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 61 | 'g' are ignored when checking the name. 62 | 63 | Send bug reports to ." 64 | exit $? 65 | ;; 66 | 67 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 68 | echo "missing $scriptversion (GNU Automake)" 69 | exit $? 70 | ;; 71 | 72 | -*) 73 | echo 1>&2 "$0: unknown '$1' option" 74 | echo 1>&2 "Try '$0 --help' for more information" 75 | exit 1 76 | ;; 77 | 78 | esac 79 | 80 | # Run the given program, remember its exit status. 81 | "$@"; st=$? 82 | 83 | # If it succeeded, we are done. 84 | test $st -eq 0 && exit 0 85 | 86 | # Also exit now if we it failed (or wasn't found), and '--version' was 87 | # passed; such an option is passed most likely to detect whether the 88 | # program is present and works. 89 | case $2 in --version|--help) exit $st;; esac 90 | 91 | # Exit code 63 means version mismatch. This often happens when the user 92 | # tries to use an ancient version of a tool on a file that requires a 93 | # minimum version. 94 | if test $st -eq 63; then 95 | msg="probably too old" 96 | elif test $st -eq 127; then 97 | # Program was missing. 98 | msg="missing on your system" 99 | else 100 | # Program was found and executed, but failed. Give up. 101 | exit $st 102 | fi 103 | 104 | perl_URL=http://www.perl.org/ 105 | flex_URL=http://flex.sourceforge.net/ 106 | gnu_software_URL=http://www.gnu.org/software 107 | 108 | program_details () 109 | { 110 | case $1 in 111 | aclocal|automake) 112 | echo "The '$1' program is part of the GNU Automake package:" 113 | echo "<$gnu_software_URL/automake>" 114 | echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" 115 | echo "<$gnu_software_URL/autoconf>" 116 | echo "<$gnu_software_URL/m4/>" 117 | echo "<$perl_URL>" 118 | ;; 119 | autoconf|autom4te|autoheader) 120 | echo "The '$1' program is part of the GNU Autoconf package:" 121 | echo "<$gnu_software_URL/autoconf/>" 122 | echo "It also requires GNU m4 and Perl in order to run:" 123 | echo "<$gnu_software_URL/m4/>" 124 | echo "<$perl_URL>" 125 | ;; 126 | esac 127 | } 128 | 129 | give_advice () 130 | { 131 | # Normalize program name to check for. 132 | normalized_program=`echo "$1" | sed ' 133 | s/^gnu-//; t 134 | s/^gnu//; t 135 | s/^g//; t'` 136 | 137 | printf '%s\n' "'$1' is $msg." 138 | 139 | configure_deps="'configure.ac' or m4 files included by 'configure.ac'" 140 | case $normalized_program in 141 | autoconf*) 142 | echo "You should only need it if you modified 'configure.ac'," 143 | echo "or m4 files included by it." 144 | program_details 'autoconf' 145 | ;; 146 | autoheader*) 147 | echo "You should only need it if you modified 'acconfig.h' or" 148 | echo "$configure_deps." 149 | program_details 'autoheader' 150 | ;; 151 | automake*) 152 | echo "You should only need it if you modified 'Makefile.am' or" 153 | echo "$configure_deps." 154 | program_details 'automake' 155 | ;; 156 | aclocal*) 157 | echo "You should only need it if you modified 'acinclude.m4' or" 158 | echo "$configure_deps." 159 | program_details 'aclocal' 160 | ;; 161 | autom4te*) 162 | echo "You might have modified some maintainer files that require" 163 | echo "the 'autom4te' program to be rebuilt." 164 | program_details 'autom4te' 165 | ;; 166 | bison*|yacc*) 167 | echo "You should only need it if you modified a '.y' file." 168 | echo "You may want to install the GNU Bison package:" 169 | echo "<$gnu_software_URL/bison/>" 170 | ;; 171 | lex*|flex*) 172 | echo "You should only need it if you modified a '.l' file." 173 | echo "You may want to install the Fast Lexical Analyzer package:" 174 | echo "<$flex_URL>" 175 | ;; 176 | help2man*) 177 | echo "You should only need it if you modified a dependency" \ 178 | "of a man page." 179 | echo "You may want to install the GNU Help2man package:" 180 | echo "<$gnu_software_URL/help2man/>" 181 | ;; 182 | makeinfo*) 183 | echo "You should only need it if you modified a '.texi' file, or" 184 | echo "any other file indirectly affecting the aspect of the manual." 185 | echo "You might want to install the Texinfo package:" 186 | echo "<$gnu_software_URL/texinfo/>" 187 | echo "The spurious makeinfo call might also be the consequence of" 188 | echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" 189 | echo "want to install GNU make:" 190 | echo "<$gnu_software_URL/make/>" 191 | ;; 192 | *) 193 | echo "You might have modified some files without having the proper" 194 | echo "tools for further handling them. Check the 'README' file, it" 195 | echo "often tells you about the needed prerequisites for installing" 196 | echo "this package. You may also peek at any GNU archive site, in" 197 | echo "case some other package contains this missing '$1' program." 198 | ;; 199 | esac 200 | } 201 | 202 | give_advice "$1" | sed -e '1s/^/WARNING: /' \ 203 | -e '2,$s/^/ /' >&2 204 | 205 | # Propagate the correct exit status (expected to be 127 for a program 206 | # not found, 63 for a program that failed due to version mismatch). 207 | exit $st 208 | 209 | # Local variables: 210 | # eval: (add-hook 'write-file-hooks 'time-stamp) 211 | # time-stamp-start: "scriptversion=" 212 | # time-stamp-format: "%:y-%02m-%02d.%02H" 213 | # time-stamp-time-zone: "UTC" 214 | # time-stamp-end: "; # UTC" 215 | # End: 216 | -------------------------------------------------------------------------------- /nudata/sys_cfg/N9H30F51I.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000005 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0x55AA55AA=0x1 44 | 0x55AA55AA=0x1 45 | 0x55AA55AA=0x1 46 | 0xB0000218=0x00000008 47 | 0xB8003060=0x00000033 48 | 0xB80030A0=0x00007FFF 49 | 0xB80030E0=0x0000FF00 50 | 0xB8003120=0x0000FFFC 51 | 0xB8003160=0x0000F800 52 | 0xB80031A0=0x0000803C 53 | 0xB80031E0=0x0000FFFC 54 | 0xB8003220=0x00000007 55 | 0xB000022C=0x00000100 56 | 0xB000022C=0x00000100 57 | 0xB000022C=0x00000100 58 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/N9H30F51IEC.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000005 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0x55AA55AA=0x1 44 | 0x55AA55AA=0x1 45 | 0x55AA55AA=0x1 46 | 0xB0000218=0x00000008 47 | 0xB8003060=0x00000033 48 | 0xB80030A0=0x00007FFF 49 | 0xB80030E0=0x0000FF00 50 | 0xB8003120=0x0000FFFC 51 | 0xB8003160=0x0000F800 52 | 0xB80031A0=0x0000803C 53 | 0xB80031E0=0x0000FFFC 54 | 0xB8003220=0x00000007 55 | 0xB000022C=0x00000100 56 | 0xB000022C=0x00000100 57 | 0xB000022C=0x00000100 58 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/N9H30F61IE.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000006 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0xB0000218=0x00000008 42 | 0xB8003160=0x00008000 43 | 0xB80031A0=0x00008000 44 | 0xB000022C=0x00000100 45 | 0xB000022C=0x00000100 46 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/N9H30F61IEC.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000006 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0xB0000218=0x00000008 42 | 0xB8003160=0x00008000 43 | 0xB80031A0=0x00008000 44 | 0xB000022C=0x00000100 45 | 0xB000022C=0x00000100 46 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/N9H30F71IE.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53EB384A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00010476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000007 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0xB0000218=0x00000008 42 | 0xB8003160=0x00008000 43 | 0xB80031A0=0x00008000 44 | 0xB000022C=0x00000100 45 | 0xB000022C=0x00000100 46 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/N9H30F71IEC.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53EB384A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00010476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000007 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0xB0000218=0x00000008 42 | 0xB8003160=0x00008000 43 | 0xB80031A0=0x00008000 44 | 0xB000022C=0x00000100 45 | 0xB000022C=0x00000100 46 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/N9H30K41I.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001808=0x00008030 7 | 0x55AA55AA=0x1 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0xB0001800=0x00030456 11 | 0x55AA55AA=0x1 12 | 0xB0001804=0x00000021 13 | 0x55AA55AA=0x1 14 | 0xB0001804=0x00000023 15 | 0x55AA55AA=0x1 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0xB0001804=0x00000027 19 | 0x55AA55AA=0x1 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0xB0001820=0x00000000 23 | 0xB0001824=0x00000000 24 | 0xB000181C=0x00004000 25 | 0xB0001818=0x00000332 26 | 0xB0001810=0x00000004 27 | 0xB0001804=0x00000027 28 | 0x55AA55AA=0x1 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0xB0001804=0x0000002B 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001818=0x00000832 35 | 0xB000181C=0x00004781 36 | 0xB000181C=0x00004405 37 | 0xB0001804=0x00000020 38 | 0xB0001834=0x00888820 39 | 0x55AA55AA=0x1 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0xB0000218=0x00000008 43 | 0xB8003060=0x00000033 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FFFC 50 | 0xB8003220=0x00000007 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/N9H30K41IEC.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001808=0x00008030 7 | 0x55AA55AA=0x1 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0xB0001800=0x00030456 11 | 0x55AA55AA=0x1 12 | 0xB0001804=0x00000021 13 | 0x55AA55AA=0x1 14 | 0xB0001804=0x00000023 15 | 0x55AA55AA=0x1 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0xB0001804=0x00000027 19 | 0x55AA55AA=0x1 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0xB0001820=0x00000000 23 | 0xB0001824=0x00000000 24 | 0xB000181C=0x00004000 25 | 0xB0001818=0x00000332 26 | 0xB0001810=0x00000004 27 | 0xB0001804=0x00000027 28 | 0x55AA55AA=0x1 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0xB0001804=0x0000002B 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001818=0x00000832 35 | 0xB000181C=0x00004781 36 | 0xB000181C=0x00004405 37 | 0xB0001804=0x00000020 38 | 0xB0001834=0x00888820 39 | 0x55AA55AA=0x1 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0xB0000218=0x00000008 43 | 0xB8003060=0x00000033 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FFFC 50 | 0xB8003220=0x00000007 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/N9H30K61I.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000006 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0xB0000218=0x00000008 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FF7C 50 | 0xB8003220=0x00000001 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC972DF51Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000005 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0x55AA55AA=0x1 44 | 0x55AA55AA=0x1 45 | 0x55AA55AA=0x1 46 | 0xB0000218=0x00000008 47 | 0xB8003060=0x00000033 48 | 0xB80030A0=0x00007FFF 49 | 0xB80030E0=0x0000FF00 50 | 0xB8003120=0x0000FFFC 51 | 0xB8003160=0x0000F800 52 | 0xB80031A0=0x0000803C 53 | 0xB80031E0=0x0000FFFC 54 | 0xB8003220=0x00000007 55 | 0xB000022C=0x00000100 56 | 0xB000022C=0x00000100 57 | 0xB000022C=0x00000100 58 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC972DF61Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000006 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0xB0000218=0x00000008 42 | 0xB8003160=0x00008000 43 | 0xB80031A0=0x00008000 44 | 0xB000022C=0x00000100 45 | 0xB000022C=0x00000100 46 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC972DF61YC.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000006 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0xB0000218=0x00000008 42 | 0xB8003160=0x00008000 43 | 0xB80031A0=0x00008000 44 | 0xB000022C=0x00000100 45 | 0xB000022C=0x00000100 46 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC972DF62Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001808=0x00008030 7 | 0x55AA55AA=0x1 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0xB0001800=0x00030476 11 | 0x55AA55AA=0x1 12 | 0xB0001804=0x00000021 13 | 0x55AA55AA=0x1 14 | 0xB0001804=0x00000023 15 | 0x55AA55AA=0x1 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0xB0001804=0x00000027 19 | 0x55AA55AA=0x1 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0xB0001820=0x00000000 23 | 0xB0001824=0x00000000 24 | 0xB000181C=0x00004000 25 | 0xB0001818=0x00000332 26 | 0xB0001810=0x00000006 27 | 0xB0001804=0x00000027 28 | 0x55AA55AA=0x1 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0xB0001804=0x0000002B 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001818=0x00000232 35 | 0xB000181C=0x00004781 36 | 0xB000181C=0x00004401 37 | 0xB0001804=0x00000020 38 | 0xB0001834=0x00888820 39 | 0x55AA55AA=0x1 40 | 0xB0000218=0x00000008 41 | 0xB8003160=0x00008000 42 | 0xB80031A0=0x00008000 43 | 0xB000022C=0x00000100 44 | 0xB000022C=0x00000100 45 | 0xB000022C=0x00000100 46 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC972DF71Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53EB384A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00010476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000007 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0xB0000218=0x00000008 42 | 0xB8003160=0x00008000 43 | 0xB80031A0=0x00008000 44 | 0xB000022C=0x00000100 45 | 0xB000022C=0x00000100 46 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC972DF71YC.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53EB384A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00010476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000007 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0xB0000218=0x00000008 42 | 0xB8003160=0x00008000 43 | 0xB80031A0=0x00008000 44 | 0xB000022C=0x00000100 45 | 0xB000022C=0x00000100 46 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC973DF62Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001808=0x00008030 7 | 0x55AA55AA=0x1 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0xB0001800=0x00030476 11 | 0x55AA55AA=0x1 12 | 0xB0001804=0x00000021 13 | 0x55AA55AA=0x1 14 | 0xB0001804=0x00000023 15 | 0x55AA55AA=0x1 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0xB0001804=0x00000027 19 | 0x55AA55AA=0x1 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0xB0001820=0x00000000 23 | 0xB0001824=0x00000000 24 | 0xB000181C=0x00004000 25 | 0xB0001818=0x00000332 26 | 0xB0001810=0x00000006 27 | 0xB0001804=0x00000027 28 | 0x55AA55AA=0x1 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0xB0001804=0x0000002B 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001818=0x00000232 35 | 0xB000181C=0x00004781 36 | 0xB000181C=0x00004401 37 | 0xB0001804=0x00000020 38 | 0xB0001834=0x00888820 39 | 0xB000022C=0x00000100 40 | 0xB000022C=0x00000100 41 | 0xB000022C=0x00000100 42 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC975DK51Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000005 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0x55AA55AA=0x1 44 | 0x55AA55AA=0x1 45 | 0x55AA55AA=0x1 46 | 0xB0000218=0x00000008 47 | 0xB8003060=0x00000033 48 | 0xB80030A0=0x00007FFF 49 | 0xB80030E0=0x0000FF00 50 | 0xB8003120=0x0000FFFC 51 | 0xB8003160=0x0000F800 52 | 0xB80031A0=0x0000803C 53 | 0xB80031E0=0x0000FFFC 54 | 0xB8003220=0x00000007 55 | 0xB000022C=0x00000100 56 | 0xB000022C=0x00000100 57 | 0xB000022C=0x00000100 58 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC975DK61Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000006 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0xB0000218=0x00000008 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FF7C 50 | 0xB8003220=0x00000001 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC975DK62Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001808=0x00008030 7 | 0x55AA55AA=0x1 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0xB0001800=0x00030476 11 | 0x55AA55AA=0x1 12 | 0xB0001804=0x00000021 13 | 0x55AA55AA=0x1 14 | 0xB0001804=0x00000023 15 | 0x55AA55AA=0x1 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0xB0001804=0x00000027 19 | 0x55AA55AA=0x1 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0xB0001820=0x00000000 23 | 0xB0001824=0x00000000 24 | 0xB000181C=0x00004000 25 | 0xB0001818=0x00000332 26 | 0xB0001810=0x00000006 27 | 0xB0001804=0x00000027 28 | 0x55AA55AA=0x1 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0xB0001804=0x0000002B 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001818=0x00000232 35 | 0xB000181C=0x00004781 36 | 0xB000181C=0x00004401 37 | 0xB0001804=0x00000020 38 | 0xB0001834=0x00888820 39 | 0xB000022C=0x00000100 40 | 0xB000022C=0x00000100 41 | 0xB000022C=0x00000100 42 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC976DK41Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001808=0x00008030 7 | 0x55AA55AA=0x1 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0xB0001800=0x00030456 11 | 0x55AA55AA=0x1 12 | 0xB0001804=0x00000021 13 | 0x55AA55AA=0x1 14 | 0xB0001804=0x00000023 15 | 0x55AA55AA=0x1 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0xB0001804=0x00000027 19 | 0x55AA55AA=0x1 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0xB0001820=0x00000000 23 | 0xB0001824=0x00000000 24 | 0xB000181C=0x00004000 25 | 0xB0001818=0x00000332 26 | 0xB0001810=0x00000004 27 | 0xB0001804=0x00000027 28 | 0x55AA55AA=0x1 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0xB0001804=0x0000002B 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001818=0x00000832 35 | 0xB000181C=0x00004781 36 | 0xB000181C=0x00004405 37 | 0xB0001804=0x00000020 38 | 0xB0001834=0x00888820 39 | 0x55AA55AA=0x1 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0xB0000218=0x00000008 43 | 0xB8003060=0x00000033 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FFFC 50 | 0xB8003220=0x00000007 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC976DK51Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000005 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0x55AA55AA=0x1 44 | 0x55AA55AA=0x1 45 | 0x55AA55AA=0x1 46 | 0xB0000218=0x00000008 47 | 0xB8003060=0x00000033 48 | 0xB80030A0=0x00007FFF 49 | 0xB80030E0=0x0000FF00 50 | 0xB8003120=0x0000FFFC 51 | 0xB8003160=0x0000F800 52 | 0xB80031A0=0x0000803C 53 | 0xB80031E0=0x0000FFFC 54 | 0xB8003220=0x00000007 55 | 0xB000022C=0x00000100 56 | 0xB000022C=0x00000100 57 | 0xB000022C=0x00000100 58 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC976DK61Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000006 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0xB0000218=0x00000008 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FF7C 50 | 0xB8003220=0x00000001 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC976DK61YC.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000006 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0xB0000218=0x00000008 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FF7C 50 | 0xB8003220=0x00000001 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC976DK62Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001808=0x00008030 7 | 0x55AA55AA=0x1 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0xB0001800=0x00030476 11 | 0x55AA55AA=0x1 12 | 0xB0001804=0x00000021 13 | 0x55AA55AA=0x1 14 | 0xB0001804=0x00000023 15 | 0x55AA55AA=0x1 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0xB0001804=0x00000027 19 | 0x55AA55AA=0x1 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0xB0001820=0x00000000 23 | 0xB0001824=0x00000000 24 | 0xB000181C=0x00004000 25 | 0xB0001818=0x00000332 26 | 0xB0001810=0x00000006 27 | 0xB0001804=0x00000027 28 | 0x55AA55AA=0x1 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0xB0001804=0x0000002B 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001818=0x00000232 35 | 0xB000181C=0x00004781 36 | 0xB000181C=0x00004401 37 | 0xB0001804=0x00000020 38 | 0xB0001834=0x00888820 39 | 0x55AA55AA=0x1 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0xB0000218=0x00000008 43 | 0xB8003060=0x00000033 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FFFC 50 | 0xB8003220=0x00000007 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC977DK41Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001808=0x00008030 7 | 0x55AA55AA=0x1 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0xB0001800=0x00030456 11 | 0x55AA55AA=0x1 12 | 0xB0001804=0x00000021 13 | 0x55AA55AA=0x1 14 | 0xB0001804=0x00000023 15 | 0x55AA55AA=0x1 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0xB0001804=0x00000027 19 | 0x55AA55AA=0x1 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0xB0001820=0x00000000 23 | 0xB0001824=0x00000000 24 | 0xB000181C=0x00004000 25 | 0xB0001818=0x00000332 26 | 0xB0001810=0x00000004 27 | 0xB0001804=0x00000027 28 | 0x55AA55AA=0x1 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0xB0001804=0x0000002B 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001818=0x00000832 35 | 0xB000181C=0x00004781 36 | 0xB000181C=0x00004405 37 | 0xB0001804=0x00000020 38 | 0xB0001834=0x00888820 39 | 0xB000022C=0x00000100 40 | 0xB000022C=0x00000100 41 | 0xB000022C=0x00000100 42 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC977DK51Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000005 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0xB0000218=0x00000008 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FF7C 50 | 0xB8003220=0x00000001 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC977DK61Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000006 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0xB0000218=0x00000008 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FF7C 50 | 0xB8003220=0x00000001 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC977DK61YC.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000006 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0xB0000218=0x00000008 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FF7C 50 | 0xB8003220=0x00000001 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC977DK62Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001808=0x00008030 7 | 0x55AA55AA=0x1 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0xB0001800=0x00030476 11 | 0x55AA55AA=0x1 12 | 0xB0001804=0x00000021 13 | 0x55AA55AA=0x1 14 | 0xB0001804=0x00000023 15 | 0x55AA55AA=0x1 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0xB0001804=0x00000027 19 | 0x55AA55AA=0x1 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0xB0001820=0x00000000 23 | 0xB0001824=0x00000000 24 | 0xB000181C=0x00004000 25 | 0xB0001818=0x00000332 26 | 0xB0001810=0x00000006 27 | 0xB0001804=0x00000027 28 | 0x55AA55AA=0x1 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0xB0001804=0x0000002B 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001818=0x00000232 35 | 0xB000181C=0x00004781 36 | 0xB000181C=0x00004401 37 | 0xB0001804=0x00000020 38 | 0xB0001834=0x00888820 39 | 0xB0000218=0x00000008 40 | 0xB80030A0=0x00007FFF 41 | 0xB80030E0=0x0000FF00 42 | 0xB8003120=0x0000FFFC 43 | 0xB8003160=0x0000F800 44 | 0xB80031A0=0x0000803C 45 | 0xB80031E0=0x0000FF7C 46 | 0xB8003220=0x00000001 47 | 0xB000022C=0x00000100 48 | 0xB000022C=0x00000100 49 | 0xB000022C=0x00000100 50 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC977DK71Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53EB384A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00010476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000007 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0xB0000218=0x00000008 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FF7C 50 | 0xB8003220=0x00000001 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC978DK41Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001808=0x00008030 7 | 0x55AA55AA=0x1 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0xB0001800=0x00030456 11 | 0x55AA55AA=0x1 12 | 0xB0001804=0x00000021 13 | 0x55AA55AA=0x1 14 | 0xB0001804=0x00000023 15 | 0x55AA55AA=0x1 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0xB0001804=0x00000027 19 | 0x55AA55AA=0x1 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0xB0001820=0x00000000 23 | 0xB0001824=0x00000000 24 | 0xB000181C=0x00004000 25 | 0xB0001818=0x00000332 26 | 0xB0001810=0x00000004 27 | 0xB0001804=0x00000027 28 | 0x55AA55AA=0x1 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0xB0001804=0x0000002B 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001818=0x00000832 35 | 0xB000181C=0x00004781 36 | 0xB000181C=0x00004405 37 | 0xB0001804=0x00000020 38 | 0xB0001834=0x00888820 39 | 0x55AA55AA=0x1 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0xB0000218=0x00000008 43 | 0xB8003060=0x00000033 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FFFC 50 | 0xB8003220=0x00000007 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC978DK51Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000005 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0x55AA55AA=0x1 44 | 0x55AA55AA=0x1 45 | 0x55AA55AA=0x1 46 | 0xB0000218=0x00000008 47 | 0xB8003060=0x00000033 48 | 0xB80030A0=0x00007FFF 49 | 0xB80030E0=0x0000FF00 50 | 0xB8003120=0x0000FFFC 51 | 0xB8003160=0x0000F800 52 | 0xB80031A0=0x0000803C 53 | 0xB80031E0=0x0000FFFC 54 | 0xB8003220=0x00000007 55 | 0xB000022C=0x00000100 56 | 0xB000022C=0x00000100 57 | 0xB000022C=0x00000100 58 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/NUC978DK61Y.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000006 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0xB0000218=0x00000008 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FF7C 50 | 0xB8003220=0x00000001 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/SCM601L216UE.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000006 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0xB0000218=0x00000008 42 | 0xB8003160=0x00008000 43 | 0xB80031A0=0x00008000 44 | 0xB000022C=0x00000100 45 | 0xB000022C=0x00000100 46 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/SCM602L128UE.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000006 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0xB0000218=0x00000008 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FF7C 50 | 0xB8003220=0x00000001 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/SCM603L128UE.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53DCD84A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00030476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000005 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0x55AA55AA=0x1 42 | 0x55AA55AA=0x1 43 | 0xB0000218=0x00000008 44 | 0xB80030A0=0x00007FFF 45 | 0xB80030E0=0x0000FF00 46 | 0xB8003120=0x0000FFFC 47 | 0xB8003160=0x0000F800 48 | 0xB80031A0=0x0000803C 49 | 0xB80031E0=0x0000FF7C 50 | 0xB8003220=0x00000001 51 | 0xB000022C=0x00000100 52 | 0xB000022C=0x00000100 53 | 0xB000022C=0x00000100 54 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/sys_cfg/SCM604L216VE.ini: -------------------------------------------------------------------------------- 1 | 0xB0000220=0x01000000 2 | 0xB0000264=0xC0000018 3 | 0xB0000220=0x01000018 4 | 0x55AA55AA=0x1 5 | 0x55AA55AA=0x1 6 | 0xB0001828=0x53EB384A 7 | 0xB0001808=0x00008014 8 | 0x55AA55AA=0x1 9 | 0x55AA55AA=0x1 10 | 0x55AA55AA=0x1 11 | 0xB0001800=0x00010476 12 | 0x55AA55AA=0x1 13 | 0xB0001804=0x00000021 14 | 0x55AA55AA=0x1 15 | 0xB0001804=0x00000023 16 | 0x55AA55AA=0x1 17 | 0x55AA55AA=0x1 18 | 0x55AA55AA=0x1 19 | 0xB0001804=0x00000027 20 | 0x55AA55AA=0x1 21 | 0x55AA55AA=0x1 22 | 0x55AA55AA=0x1 23 | 0xB0001820=0x00000000 24 | 0xB0001824=0x00000000 25 | 0xB000181C=0x00004000 26 | 0xB0001818=0x00000332 27 | 0xB0001810=0x00000007 28 | 0xB0001804=0x00000027 29 | 0x55AA55AA=0x1 30 | 0x55AA55AA=0x1 31 | 0x55AA55AA=0x1 32 | 0xB0001804=0x0000002B 33 | 0xB0001804=0x0000002B 34 | 0xB0001804=0x0000002B 35 | 0xB0001818=0x00000232 36 | 0xB000181C=0x00004781 37 | 0xB000181C=0x00004401 38 | 0xB0001804=0x00000020 39 | 0xB0001834=0x00888820 40 | 0x55AA55AA=0x1 41 | 0xB0000218=0x00000008 42 | 0xB8003160=0x00008000 43 | 0xB80031A0=0x00008000 44 | 0xB000022C=0x00000100 45 | 0xB000022C=0x00000100 46 | 0xB000022C=0x00000100 -------------------------------------------------------------------------------- /nudata/xusb.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NuWriter_CMD/1328b106fff6e3ce846fad2d541b453c802a93ba/nudata/xusb.bin -------------------------------------------------------------------------------- /nudata/xusb128.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NuWriter_CMD/1328b106fff6e3ce846fad2d541b453c802a93ba/nudata/xusb128.bin -------------------------------------------------------------------------------- /nudata/xusb16.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NuWriter_CMD/1328b106fff6e3ce846fad2d541b453c802a93ba/nudata/xusb16.bin -------------------------------------------------------------------------------- /nudata/xusb64.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenNuvoton/NUC970_NuWriter_CMD/1328b106fff6e3ce846fad2d541b453c802a93ba/nudata/xusb64.bin -------------------------------------------------------------------------------- /parse.c: -------------------------------------------------------------------------------- 1 | 2 | #include "common.h" 3 | #include /* sleep */ 4 | #include 5 | 6 | int init_xusb(void) 7 | { 8 | 9 | int ret=0; 10 | char DDR[256]; 11 | char XUSB[256]; 12 | int bResult,dlen,xlen; 13 | unsigned char *dbuf=NULL,*xbuf=NULL; 14 | 15 | ret=NUC_OpenUsb(); 16 | if(ret<0) return -1; 17 | 18 | sprintf(DDR,"%s/sys_cfg/%s",Data_Path,DDR_fileName); 19 | dbuf=load_ddr(DDR,&dlen); 20 | if(dbuf==NULL) { 21 | ret=-1; 22 | goto EXIT; 23 | } 24 | bResult=DDRtoDevice(dbuf,dlen); 25 | if(bResult==RUN_ON_XUSB) { 26 | ret=bResult; 27 | goto EXIT; 28 | } 29 | if(bResult<0) { 30 | printf("init_xusb:Burn DDR to Device failed,bResult=%d\n",bResult); 31 | ret=bResult; 32 | goto EXIT; 33 | } 34 | if(DDR_fileName[strlen(DDR_fileName)-7]=='7') { 35 | MSG_DEBUG("load xusb128.bin\n"); 36 | sprintf(XUSB,"%s/xusb128.bin",Data_Path); 37 | } else if(DDR_fileName[strlen(DDR_fileName)-7]=='6') { 38 | MSG_DEBUG("load xusb64.bin\n"); 39 | sprintf(XUSB,"%s/xusb64.bin",Data_Path); 40 | } else if(DDR_fileName[strlen(DDR_fileName)-7]=='5') { 41 | MSG_DEBUG("load xusb32.bin\n"); 42 | sprintf(XUSB,"%s/xusb.bin",Data_Path); 43 | } else { 44 | MSG_DEBUG("load xusb16.bin\n"); 45 | sprintf(XUSB,"%s/xusb16.bin",Data_Path); 46 | } 47 | xbuf=load_xusb(XUSB,&xlen); 48 | if(xbuf==NULL) { 49 | printf("Cannot find xusb.bin\n"); 50 | ret=-1; 51 | goto EXIT; 52 | } 53 | if(XUSBtoDevice(xbuf,xlen)<0) { 54 | printf("Burn XUSB to Device failed\n"); 55 | ret=-1; 56 | goto EXIT; 57 | } 58 | NUC_CloseUsb(); 59 | sleep(1); 60 | while(get_device_num_with_vid_pid(ctx,USB_VENDOR_ID, USB_PRODUCT_ID)!=dev_count) { 61 | sleep(1); 62 | } 63 | ret=NUC_OpenUsb(); 64 | if(ret<0) return -1; 65 | EXIT: 66 | usleep(100); 67 | return ret; 68 | } 69 | 70 | int ParseFlashType(void) 71 | { 72 | int ret; 73 | if((ret=init_xusb())<0) { 74 | printf("initail xusb failed %d\n",ret); 75 | return -1; 76 | } 77 | 78 | if(InfoFromDevice()<0) { 79 | printf(" Get information failed for Device\n"); 80 | return -1; 81 | } 82 | switch(mode) { 83 | case SDRAM_M: 84 | MSG_DEBUG("ParseFlashType-SDRAM_M\n"); 85 | if(UXmodem_SDRAM()<0) return -1; 86 | break; 87 | case NAND_M: 88 | MSG_DEBUG("ParseFlashType-NAND_M\n"); 89 | if(UXmodem_NAND()<0) return -1; 90 | break; 91 | case SPI_M: 92 | MSG_DEBUG("ParseFlashType-SPI_M\n"); 93 | if(UXmodem_SPI()<0) return -1; 94 | break; 95 | case EMMC_M: 96 | MSG_DEBUG("ParseFlashType-EMMC_M\n"); 97 | if(UXmodem_EMMC()<0) return -1; 98 | break; 99 | default: 100 | MSG_DEBUG("Unsupported Flash Type!/n"); 101 | return -1; 102 | } 103 | 104 | return 0; 105 | } 106 | -------------------------------------------------------------------------------- /read_file.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | /** 6 | * @brief Load ddr file 7 | * @param FilePath file path 8 | * @param len ddr length 9 | * @return ddr buffer address 10 | * @details This function read ddr into buffer. 11 | */ 12 | char* load_ddr(char *FilePath,int *len) 13 | { 14 | FILE *pf; 15 | char *buf; 16 | char tmp[512]; 17 | int length,tmpbuf_size; 18 | int i; 19 | char *ptmpbuf,*ptmp,cvt[128]; 20 | unsigned int * puint32_t; 21 | unsigned int val=0; 22 | buf=(char *)malloc(sizeof(char)*512); 23 | memset(buf,0,512); 24 | puint32_t=(unsigned int *)buf; 25 | pf=fopen(FilePath, "rb"); 26 | if(pf==NULL) { 27 | printf("cannot open %s\n",FilePath); 28 | *len = 0; 29 | return NULL; 30 | } 31 | tmpbuf_size=0; 32 | while(fgets(tmp,512,pf) != NULL) { 33 | ptmp=strchr(tmp,'='); 34 | strncpy((char *)cvt,(char *)tmp,(unsigned long)ptmp-(unsigned long)tmp); 35 | cvt[(unsigned long)ptmp-(unsigned long)tmp]='\0'; 36 | val=strtoul(cvt,NULL,0); 37 | *puint32_t=val; 38 | puint32_t++; 39 | tmpbuf_size+=4; 40 | strncpy(cvt,++ptmp,strlen(ptmp)); 41 | cvt[strlen(ptmp)]='\0'; 42 | val=strtoul(cvt,NULL,0); 43 | *puint32_t=val; 44 | puint32_t++; 45 | tmpbuf_size+=4; 46 | } 47 | *len=tmpbuf_size; 48 | fclose(pf); 49 | return buf; 50 | } 51 | 52 | 53 | /** 54 | * @brief Load xusb file 55 | * @param FilePath file path 56 | * @param len xusb length 57 | * @return xusb buffer address 58 | * @details This function read xusb into buffer. 59 | */ 60 | char * load_xusb(char *FilePath,int *len) 61 | { 62 | FILE *fp; 63 | char *buf; 64 | fp=fopen(FilePath, "rb"); 65 | if(fp==NULL) { 66 | printf("cannot open %s\n",FilePath); 67 | *len = 0; 68 | return NULL; 69 | } 70 | fseek(fp,0,SEEK_END); 71 | *len=ftell(fp); 72 | fseek(fp,0,SEEK_SET); 73 | buf=(char *)malloc(sizeof(char)*(*len)); 74 | fread(buf,*len,1,fp); 75 | fclose(fp); 76 | return buf; 77 | 78 | } 79 | 80 | #if 0 81 | int main(int argc, char **argv) 82 | { 83 | unsigned char *dbuf,*buf; 84 | unsigned int *p32; 85 | int dlen,len; 86 | int i; 87 | 88 | dbuf=load_ddr("Release/sys_cfg/NUC972DF62Y.ini",&dlen); 89 | 90 | printf("len=%d\n",dlen); 91 | p32=(unsigned int *)dbuf; 92 | for(i=0; i<(dlen/4); i+=2) { 93 | printf("%08x=%08x \t",*(p32+i),*(p32+i+1)); 94 | if((i+2)%8==0) printf("\n"); 95 | } 96 | printf("\n"); 97 | 98 | buf=load_xusb("Release/xusb64.bin",&len); 99 | printf("S:"); 100 | for(i=0; i<16; i++) 101 | printf("%02x ",buf[i]); 102 | printf("\nE:"); 103 | for(i=(len-16); i