From aea00f496b1cf41fd5b568b4c6079c2ab76eafd4 Mon Sep 17 00:00:00 2001 From: Philipp Deppenwiese Date: Wed, 28 Nov 2018 18:50:11 +0100 Subject: broadcom: Remove SoC and board support The reason for this code cleanup is the legacy Google Purin board which isn't available anymore and AFAIK never made it into the stores. * Remove broadcom cygnus SoC support * Remove /util/broadcom tool * Remove Google Purin mainboard * Remove MAINTAINERS entries Change-Id: I148dd7eb0192d396cb69bc26c4062f88a764771a Signed-off-by: Philipp Deppenwiese Reviewed-on: https://review.coreboot.org/c/29905 Reviewed-by: Julius Werner Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- util/broadcom/secimage/io.c | 123 -------------------------------------------- 1 file changed, 123 deletions(-) delete mode 100644 util/broadcom/secimage/io.c (limited to 'util/broadcom/secimage/io.c') diff --git a/util/broadcom/secimage/io.c b/util/broadcom/secimage/io.c deleted file mode 100644 index f5be50afc7..0000000000 --- a/util/broadcom/secimage/io.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2015 Broadcom Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation version 2. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include -#include -#include "secimage.h" - -/*---------------------------------------------------------------------- - * Name : ReadBinaryFile - * Purpose : Read some data from file of raw binary - * Input : fname : file to be read - * buf : buffer which is the data desitnation - * maxlen : maiximum length of data to be read - * Output : none - *---------------------------------------------------------------------*/ -int ReadBinaryFile(char *fname, uint8_t *buf, int maxlen) -{ - FILE *fp = NULL; - int len = 0; - - fp = fopen(fname, "rb"); - if (fp == NULL) - return 0; - printf("fname=%s, len=%d\n", fname, maxlen); - len = fread(buf, 1, maxlen, fp); - fclose(fp); - - return len; -} - -/*---------------------------------------------------------------------- - * Name : FileSizeGet - * Purpose : Return the size of the file - * Input : file: FILE * to the file to be processed - * Output : none - *---------------------------------------------------------------------*/ -size_t FileSizeGet(FILE *file) -{ - long length; - - fseek(file, 0, SEEK_END); - length = ftell(file); - rewind(file); - return (size_t)length; -} - -/*---------------------------------------------------------------------- - * Name : DataRead - * Purpose : Read all the data from a file - * Input : filename : file to be read - * buf : buffer which is the data destination - * length : length of data to be read - * Output : none - *---------------------------------------------------------------------*/ -int DataRead(char *filename, uint8_t *buf, int *length) -{ - FILE *file; - int len = *length; - - file = fopen(filename, "rb"); - if (file == NULL) { - printf("Unable to open file: %s\n", filename); - return -1; - } - len = FileSizeGet(file); - if (len < 0) { - printf("Unable to seek in file: %s\n", filename); - fclose(file); - return -1; - } - if (len < *length) - *length = len; - else - /* Do not exceed the maximum length of the buffer */ - len = *length; - if (fread((uint8_t *)buf, 1, len, file) != len) { - printf("Error reading data (%d bytes) from file: %s\n", - len, filename); - fclose(file); - return -1; - } - fclose(file); - return 0; -} - -/*---------------------------------------------------------------------- - * Name : DataWrite - * Purpose : Write some binary data to a file - * Input : filename : file to be written - * buf : buffer which is the data source - * length : length of data to be written - * Output : none - *---------------------------------------------------------------------*/ -int DataWrite(char *filename, char *buf, int length) -{ - FILE *file; - - file = fopen(filename, "wb"); - if (file == NULL) { - printf("Unable to open output file %s\n", filename); - return -1; - } - if (fwrite(buf, 1, length, file) < length) { - printf("Unable to write %d bytes to output file %s (0x%X).\n", - length, filename, ferror(file)); - fclose(file); - return -1; - } - - fflush(file); - fclose(file); - return 0; -} -- cgit v1.2.3