Skip to content

Commit

Permalink
software/kernel: Update copyrights, fix compilation warning, remove u…
Browse files Browse the repository at this point in the history
…nused functions and add ICAP flags.
  • Loading branch information
enjoy-digital committed Oct 2, 2024
1 parent 9255e10 commit 867c818
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 43 deletions.
2 changes: 1 addition & 1 deletion litepcie/software/kernel/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
*/

Expand Down
17 changes: 14 additions & 3 deletions litepcie/software/kernel/flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
2 changes: 1 addition & 1 deletion litepcie/software/kernel/litepcie.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
*/

Expand Down
40 changes: 2 additions & 38 deletions litepcie/software/kernel/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
*/

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 867c818

Please sign in to comment.