diff --git a/litepcie/software/kernel/config.h b/litepcie/software/kernel/config.h index e7da5d0..7c3109a 100644 --- a/litepcie/software/kernel/config.h +++ b/litepcie/software/kernel/config.h @@ -4,7 +4,7 @@ * * This file is part of LitePCIe. * - * Copyright (C) 2018-2023 / EnjoyDigital / florent@enjoy-digital.fr + * Copyright (C) 2018-2024 / EnjoyDigital / florent@enjoy-digital.fr * */ diff --git a/litepcie/software/kernel/flags.h b/litepcie/software/kernel/flags.h index 7e3b924..3708432 100644 --- a/litepcie/software/kernel/flags.h +++ b/litepcie/software/kernel/flags.h @@ -4,20 +4,31 @@ * * This file is part of LitePCIe. * - * Copyright (C) 2018-2023 / EnjoyDigital / florent@enjoy-digital.fr + * Copyright (C) 2018-2024 / EnjoyDigital / florent@enjoy-digital.fr * */ #ifndef __HW_FLAGS_H #define __HW_FLAGS_H -/* spi */ +/* SPI */ #define SPI_CTRL_START (1 << 0) #define SPI_CTRL_LENGTH (1 << 8) #define SPI_STATUS_DONE (1 << 0) -/* pcie */ +/* PCIe */ #define DMA_TABLE_LOOP_INDEX (1 << 0) #define DMA_TABLE_LOOP_COUNT (1 << 16) +/* ICAP */ +#define ICAP_CMD_REG 0b00100 +#define ICAP_CMD_IPROG 0b01111 + +#define ICAP_IDCODE_REG 0b01100 + +#define ICAP_BOOTSTS_REG 0b10110 +#define ICAP_BOOTSTS_VALID (1 << 0) +#define ICAP_BOOTSTS_FALLBACK (1 << 1) + + #endif /* __HW_FLAGS_H */ diff --git a/litepcie/software/kernel/litepcie.h b/litepcie/software/kernel/litepcie.h index 5f1dc78..89aaaf3 100644 --- a/litepcie/software/kernel/litepcie.h +++ b/litepcie/software/kernel/litepcie.h @@ -4,7 +4,7 @@ * * This file is part of LitePCIe. * - * Copyright (C) 2018-2023 / EnjoyDigital / florent@enjoy-digital.fr + * Copyright (C) 2018-2024 / EnjoyDigital / florent@enjoy-digital.fr * */ diff --git a/litepcie/software/kernel/main.c b/litepcie/software/kernel/main.c index b8c10e7..fb4ad7d 100644 --- a/litepcie/software/kernel/main.c +++ b/litepcie/software/kernel/main.c @@ -4,7 +4,7 @@ * * This file is part of LitePCIe. * - * Copyright (C) 2018-2023 / EnjoyDigital / florent@enjoy-digital.fr + * Copyright (C) 2018-2024 / EnjoyDigital / florent@enjoy-digital.fr * */ @@ -312,7 +312,7 @@ static void litepcie_dma_reader_stop(struct litepcie_device *s, int chan_num) dmachan->reader_sw_count = 0; } -void litepcie_stop_dma(struct litepcie_device *s) +static void litepcie_stop_dma(struct litepcie_device *s) { struct litepcie_dma_chan *dmachan; int i; @@ -965,42 +965,6 @@ static void litepcie_free_chdev(struct litepcie_device *s) } } -/* from stackoverflow */ -void sfind(char *string, char *format, ...) -{ - va_list arglist; - - va_start(arglist, format); - vsscanf(string, format, arglist); - va_end(arglist); -} - -struct revision { - int yy; - int mm; - int dd; -}; - -int compare_revisions(struct revision d1, struct revision d2) -{ - if (d1.yy < d2.yy) - return -1; - else if (d1.yy > d2.yy) - return 1; - - if (d1.mm < d2.mm) - return -1; - else if (d1.mm > d2.mm) - return 1; - else if (d1.dd < d2.dd) - return -1; - else if (d1.dd > d2.dd) - return 1; - - return 0; -} -/* from stackoverflow */ - /* Function to probe the LitePCIe PCI device */ static int litepcie_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) {