Zynq petalinux i2c. 10) November 25, 2013.

Zynq petalinux i2c On this folder we can find 2 devices. You will now boot Linux on the Zynq-7000 SoC ZC702 target board using JTAG mode. Register addresses In this video I go through Xilinx vivado projects for both ZCU102 and Z-Turn boards. I’m not using Jupyter notebooks. However, the goal of the project was t I can read correctly the i2c eeprom from petalinux via i2c-tools. Introduction The LogiCORE™ IP AXI IIC Bus Interface connects to the AMBA® AXI specification and provides a low-speed, two-wire, I am working on a Microzed board which has a zynq 7000 soc. I need to configure EEPROM in "read/write" mode in Linux kernel 4. 2 GPIO project for KR260, Kria Robotics Board. x Zynq UltraScale+ MPSoC: How to get MAC address from EEPROM on ZCU102 Board using PetaLinux? Zynq-7000 AP SoC Spectrum Analyzer part 1 - Accelerating Software & More - Installing and Running the Spectrum Analyzer Demo Tech Tip 2014. Key Features and Benefits Compliant to industry standard I 2 C protocol I'm upgrading from ISE/Petalinux to Vivado/Petalinux 2018. Pin controller driver provides a platform independent way for I2C IP driver to configure I2C function pins as GPIO, let the driver toggle it and reconfigure it back to I2C function pins. Typically, these devices interface with the FPGA using a In this video I go through the steps required for building petalinux for ZCU102 board. What I want to do, is very simple. I want to send UDP packets through the SFP from my FPGA to a PC. The result I expect is to see an i2c device created for my bus (ex /dev/i2c-2). The official Linux kernel from Xilinx. 2 with default kernel 3. dtb, and rootfs. Hi. 04. 4. Additionally, ensure that you connect the Interrupt to the PS The purpose of this page is to introduce two methods for interacting with GPIO from user space on Zynq-7000 and Zynq Ultrascale+ MPSoC: the SysFs interface and the Linux kernel drivers (gpio-keys, leds-gpio). I am trying to bringup a sensor (using I2C) on petalinux system based on Zynq US+ MPSoC. EEPROM chip used in Hardware : AT24MAC602 In the example above, SPI 0 in the Zynq MPSoC PS is available for use with both slave select zero and one. 2K. Xilinx Phy VideoPhy Driver I2C is not enabled in the current default kernel configuration. u-boot files. 475973] cdns-i2c ff020000. Design sources are available upon a donation to googoolia. How add drivers for Zynq Ultrascale MPSoc Standalone USB device driver This example does slave monitoring of an I2C slave device. As can be seen in the snippet above from the Zynq data sheet, the value of pull up varies between 10K and 8. 02a-English/axi_iic_ds756. A more robust approach would be to scan for the correct i2c bus as suggested in this post, but the quick-fix was enough for me. I create a petalinux project and configure it to use I2C. Set up the board as described in Setting Up the Board. 2 and I have no problem talking to my I2C devices using PS I2C (Cadence driver). Configure the Kernel to include user mode SPI device driver support. There are not MIO connected to Pmod, so I use EMIO. 0, Gigabit Ethernet SD/SDI, UART, CAN, I2C, SPI, GPIO – FPGA PCI Express Gen2 x4/x8 Transceivers 6. [ 0. We then show how it is possibl Hi, I’m not able to bring U-Boot to read MAC address from attached I2C EEPROM (custom board) with PetaLinux 2020. Part 5 Video. Driver Information There are a number of drivers in the kernel tree due to history and they may work, but the following list of drivers are currently what's tested and users are encouraged to use these rather than others. [ 9. The application I'm working on uses mmap to access the Zynq peripherals (PS SPI, I2C, etc) and does not use any of the drivers. I designed a custom board with reference to the Ultra96-V2 board. CONFIG_I2C_XILINX=y Devicetree. U-Boot 2015. com/v/u/1. The numbering scheme is: spidev<SPI device>,<Slave Select> PetaLinux Getting Started Linux I2C Aardvark The Zynq Programmable Logic (PL) can be programmed by the First Stage Bootloader (FSBL), U-Boot or through Linux. 2 including an "Audio Formatter" core as well as the receiver and transmitter cores as well as an I2C core for When experimenting with custum IP and device drivers (following UG1165), I disabled both I2C ports on the Zynq within the BD. pinctrl: zynq pinctrl initialized. Custom board using a Zynq 7020 that has been running for a while after being configured with ISE 14. Since the Zynq contains both a dual core ARM Cortex-A9 and programmable logic elements, it offers some interesting options for development. h Dear all, I want to ask you about if you have an existing i2c code to be able to access to the PmBus values for Power Management on the Zynq UltraScale\+ plattform (ZCU102). 2 On Zynq Getting Started Guide Linux I2C Aardvark This page has been deprecated and will no longer be updated. I am using a Zedboard with a Zynq 7000 processing system and an ADAU1761 audio codec. Step 3: Editing the Image As we want to be as compatible as possible between the baremetal and the linux applications, I adapted the code from Xilinx for XIic_Send/XIic_Recv (simply checking that it compiles under our petalinux through the adaptation of the includes, etc) to keep the same application code. I have seen that I2C support is enabled in zynq-common. Running Linux, writing to the I2C registers using dev/mem. Running on a custom board using a Zynq 7020. 3 Zynq UltraScale+ MPSoC: PetaLinux Warm-Restart BSP fails to wakeup Ethernet when FPD is off (Xilinx Answer 71028) Linux: FSBL Petalinux 2022. 2 I can read correctly the i2c eeprom from U-Boot via CONFIG_SYS_I2C_EEPROM_ADDR 0x50 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW 0x0 CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET 0x20 >CONFIG_SYS_EEPROM_SIZE 4096 | Hello all, I am currently trying to get the LogiCORE I2S Transmitter/Receiver to work with Petalinux 2021. On Vivado I create my hardware . Sep 23, 2021; Knowledge; Information. that are well written and tested (Side note: Soft-processors such as the MicroBlaze are an AXI IIC supports all features, except high speed mode, of the Philips I2C-Bus Specification. Vivado project for ZCU102 contains AXI I2C master, AXI SPI master and AX I have an UltraScale+ MPSoc. xsa file into petalinux. Hello guys! I'm new to Vivado and Zynq devices and I'm facing a few problems that I can't get past them. i2c: timeout waiting on comp petalinux-config --get-hw-description=<path to HDF> The system config window will appear. axi_iic_ds756. The memory I am confused about how to connect the SFP in my Zynq Ultrascale MPSOC board (ZCU102). I built the project from zcu102. This config can also be opened using the petalinux-config command. i2c@80005000 Refer to the AR 66006 for configuring the SFP and SI5324 using I2C in FSBL Also user can copy the files present in fsbl_patch_files folder to configure the clock and SFP for SGMII. Intermediate Full instructions provided 1 hour 300. Android 4. Contribute to Xilinx/linux-xlnx development by creating an account on GitHub. But I got no communication using AXI IIC. PetaLinux SDK User Guide Zynq All Programmable SoC Linux-FreeRTOS AMP Guide UG978 (v2013. Enable I2C 1 on MIO 24- 25, SPI 1 on MIO 6-11, UART 1 on MIO 36-37 and enable GPIO0 MIO and GPIO1 MIO. So far the most convenient option seems to be building my own drivers in a way as it's shown in 1165, compiling the app with arm-linux-gnueabiihf-gcc and sending app. elf --fpga pl_eth_sfp. com In summary, the project allows the user to type directly to the LCD connected to one of the Zynq PS's I2C controllers. To add to this discussion, I am trying to get the DS3231 RTC working using PetaLinux 2014. 19. I2C Bus 0 is the mux I2C EEPROM The I2C EEPROM can be read and written from sysfs such that is can be used programmatically or from a bash script. 837114] zynq-pinctrl 700. The following steps may be used to enable the driver in the kernel configuration. i2c: 400 kHz mmio ff020000 irq 32 [ 9. 1 and Vitis 2020. 07 (May 03 2018 - 11:31:43 -0500) I2C: Error, wrong i2c adapter 0 max 0 possible Error, wrong i2c adapter 0 max 0 possible ready DRAM: ECC disabled 512 MiB MMC: zynq_sdhci: 0 SF: Detected N25Q512A with page size 256 Bytes, erase size 4 KiB, total 64 MiB It's partially in my device tree under amba_pl, but I don't see the expected driver probes under Linux. We are using Eclypse Z7 board and I have a petalinux built with the FPGA's XSA with added I2c LogiCORE IP AXI IIC. petalinux-config was ok, i tryied to modify the device-tree like in the example to use the xlnx driver but the linux doesnt register the /dev/i2c module. Configure the root FS to In this video and the following 2 or 3 videos we create a vivado design that contains GPIO, I2C and SPI interfaces for ZCU102. 3 • Toggle SCL line as if it’s a GPIO to recover I2C bus lockup. Currently the device tree is as follows: ps7_i2c_0: ps7-i2c@e0004000 {bus-id = <0>; clock-frequency = <400000>; I guess the bindings for Zynq's I2C controller are 73079 - 2019. In Vivado, I have an AXI I2C peripheral on PS_MIO14 and PS_MIO15. I have enabled the Xilinx I2C Controller in my PetaLinux (v2016. Note: The SysFs driver has been tested and is working. Please refer to the new PetaLinux page for up to date information. So is there any drivers or method to debug this error? I have enabled packagegroup-display-test in rootfs also. Using petalinux-build to compile a project seems to be an overkill. How can I add these to busybox or Xilinx Release Images are build as a Flattened Image Trees with verified boot enabled so the content of those images cannot be modified on runtime and be used for booting purposes. It's partially in my device tree under amba_pl, but I don't see the expected driver probes under Linux. 2 - Tutorial!. ></p> Best regards, <p></p><p></p> I also get this when I try any u-boot i2c command on the u-boot command line. 1 is running in Ubuntu 18. Any AXI-IIC I/O needs to use the Xilinx Linux driver. I have the an EEPROM with a 2 bytes addressing where the MAC address is stored, and i would like uboot to initialize the MAC of the eth interface. xilinx. We test our design by connecting a ZYNQ board to ZCU102 and monitoring the waveforms at its side. Currently the device tree is as follows: ps7_i2c_0: ps7-i2c@e0004000 {bus-id = <0>; clock-frequency = <400000>; I guess the bindings for Zynq's I2C controller are I am working on a Microzed board which has a zynq 7000 soc. Board: Xilinx Zynq. Model: Zynq ZC706 Development Board Board: Xilinx Zynq Silicon: v3. 2) October 19, 2022 See all versions of this document Xilinx is creating an environment where employees, customers, and I'm having problems adding AXI I2C support to my ZedBoard. 2 petalinux-build 时出错,FSBL uses these IPs but are missing in the design: psu_i2c_0 Yocto, PetaLinux: 2018. ub, and boot. There are two I2C I/O interfaces on the Zynq on the processor side, completely controlled and accessed by SW only. Insert a Zynq UltraScale+ MPSoC IP block and run block automation and apply the block preset. Change Log. Now I wanted to start and incorporate some AXI peripherals in the PL to test some I2C chips through the PMOD port. These use the Cadence driver. 1 I2C: ready DRAM: ECC disabled 1 GiB MMC: mmc@e0100000: 0 (SD) SF: Detected s25fl128s_64k with page size 512 Bytes, erase size Refer to the AR 66006 for configuring the SFP and SI5324 using I2C in FSBL Also user can copy the files present in fsbl_patch_files folder to configure the clock and SFP for SGMII. I2C: ready. I have done the basic design, added constraints and exported hardware. DRAM: ECC disabled 1 GiB. Please ignore my first post which uses pmod I2C which is under PL. In first steps I want to test I2C through EMIO. However, this also makes the process for getting started a Zynq UltraScale+ RFSoC. in busybox, but they are not included in the list of applets. The AXI-IIC block is independent of the Zynq based I2C. Zynq® Ultrascale+™ MPSoC. The SFP I have is: DM7041-R. 4 and I2C doesn't seem to be working. The Within PetaLinux, we need to do the following: Create a project targeting the Zynq MPSOC. I am using cadence I2C driver to communicate with slave devices. dtsi file, which I added myself. MMC: sdhci@e0100000: 0 (SD) SF: Detected n25q128a with page size 256 Bytes, erase size 64 KiB I2C Devices (>=14. elf to my Microzed's USB stick, so that the application will not disappear after Zynq is reset. 252703] pinctrl core: initialized pinctrl subsystem [ 1. ps7_i2c_1 is the EEPROM connection. I am trying to change the frequency of I2C driver using the variable "clock-frequency = <100000>;" But, the frequency is not changing to 100k from the default 400k. I need to store data on EEPROM. From petalinux2019. x Zynq UltraScale+ MPSoC: Yocto or PetaLinux throws warnings when the build do_rootfs task completes (Xilinx Answer 71110) Linux: Drivers: 2018. In Sync with Mainline driver. Following link discusses this problem statement in detail. Notice of Disclaimer The information disclosed to you hereunder (the "Materials") is provided solely for the selection To add to this discussion, I am trying to get the DS3231 RTC working using PetaLinux 2014. I have migrated from 4. I wrote some C code and calls linux file operations like open(), read(), and write() directly targets device /dev/i2c-1, but looks like it does not work. I run the command line devmem utility and I read Integrating Raspberry Pi SenseHAT with AMD-Xilinx Kria KR260 and Petalinux 2022. gz. I am running petalinux on it. When bundling the compiled bitstream with a modified Petalinux for the Arty-Z7, this gives continous errors in the terminal (cdns-i2c e0004000. 1? The standard driver for the Zynq PS I2C controller under PetaLinux is Cadence I2C_cadence which operates the PS I2C controller through its registers. When I boot these images using Model: Zynq ZC702 Development Board. 1. Regular readers of this blog and my Hackster projects will note that I tend to use either bare metal applications or PYNQ when developing software as part of them. Then I set the I2C controller to be compatible with generic-uio. This will be running on Pynq v2. ruby packagegroup-petalinux-qt qtbase-mkspecs qtbase-plugins qtsystems-mkspecs qttranslations-qtbase qttranslations-qthelp qtconnectivity-mkspecs qttranslations-qtconnectivity qtdeclarative ZYNQ Ultrascale+ and PetaLinux – part 3 – SPI, I2C and SPI interfaces for ZCU102. 1 and Linux kernel version 4. 2) All of the following devices are connected to the I2C bus through a 1:8 mux/switch. $ petalinux-create --type project --template zynq --name zc702_iic_PetaLinux $ cd zc702_iic_Petalinux $ petalinux-config --get-hw-description=<Vivado_Export_to_SDK_Directory> I exit the window “linux System Configuration” $ petalinux-config -c kernel Not sure what Cadence means by the Zynq has two I2C hard IP. To start with, I found in the schematic an I2C bus to configure the SFP. I2C addressing uses 7 bits; however, many I2C data sheets specify 8-bit addresses, which Zynq Ultrascale MPSoc Standalone USB device driver This page gives an overview of the bare-metal driver support for the AXI I2C controller. Programming the PL at different stages may be advantageous for different projects and workflows. scr files to the SD card. 2. Upgrading to Vivado and PetaLinux 2016. Change hardware is available to it such as the USB and Ethernet PHYs, sound driver (ALSA), graphics for the HDMI port, and the I2C drivers for Booting Linux on the Target Board¶. Of course, we also develop solutions using PetaLinux and that can be very useful when we want to run a minimal embedded Linux solution. util-linux cpufrequtils bridge-utils mtd-utils usbutils pciutils can-utils i2c-tools smartmontools e2fsprogs. Question 1) In order to operate this custom board as an I2C slave, I programmed the bare metal program xiicps_polled_slave_example and confirmed the operation. I got Petalinux 2014. 2023 I am trying to utilize the PS I2C peripheral I2C 0 (master) in order to communicate with a PMOD RTCC (real-time clock calendar using the Microchip MCP79410/79411/79412 IC) operating as an I2C slave device. The page describes the configuration process and usage of the U-Boot i2c driver used on Zynq-7000 and Zynq Ultrascale+. If pin control subsystem is not used then both I2C and CAN will independently try to use these pins. In my system-user file I added this node: #define CONFIG_I2C_EEPROM; #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50; #define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW 0x0; In the menuconfig for u-boot, make sure that CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET is set Title 70176 - 2018. petalinux-config -c rootfs > base > i2c-tools; I also checked that the driver was enabled in To realize that, I use SPI , I2C and UART to the PS. cpio. Change the boot mode to SD boot. Device number 1 is corresponding with the XADC integrated on the Zynq part, and device0 will be our ADC. 10. Petalinux 2020. The development environment is Xilinx Vivado 2020. PetaLinux will create a top level folder the same name as the project name you pass it with the ‘-name’ option to place the project in. Video mixer is successfully probed but there are no any Devices enumerated at /dev/dri. bit --u-boot (1000base-x) Introduction The Trenz Electronic TE0726, also known as the ZynqBerry, is a Raspberry Pi Model 2 B form factor single board computer that uses a Xilinx Zynq SoC. The HDF import into the PetaLinux build produces the following in my device tree. After generating a bit stream with just the ZynqMP and an AXI I2C block I can not get the petalinux image to properly boot. As no system level changes are needed, you can exit out of the window and then save. Xilinx Zynq MP First Stage Boot Loader Release 2022. bsp file and using petalinux get hardware command, imported the . h (line 186): Zynq™ UltraScale+™ MPSoC - Graphics Driver Stack - Mali 400. com. I tried to modify the existing code from the tutorial provided by Xilinx for the ZC702 Board, but I got several problems. The embedded Linux solution provides easy access to networking, along with Hi all, I am trying to add I2C support to U-boot, in order to acces an EEPROM where are stored some boot information. Well the user level /dev/i2c0 writes were not working, so I added a custom module with the i2c_cadence as the basis and connected it to the I2C0 controller in the device tree to see how the driver was failing. A modification I haven't seen mentioned elsewhere: when doing the IP upgrade in Vivado it has a habit of clobbering some Zynq Versions Zynq-7000 SoC – Single/Dual ARM Cortex-A9 32-bit Up to 1 GHz L1 Cache 32KB L2 Cache 512KB On-chip Memory 256KB – I/O DDR3, DDR2 RAM USB 2. 1-2018. How do I ensure that my device tree has the I2C peripherals properly configured? Solution The easiest way to ensure that your Linux system is properly configured for the Zynq development Reading/writing over IIC/I2C in petalinux I was expecting to be able to use i2cget, i2cset etc. We then show how it is possible to talk to these peripherals using PetaLinux. The GPIO subsystem is documented in the kernel documentation in Documentation/gpio/. The device is on the 3rd virtual I2C bus off of the mux. I can see SCL of correct speed (400kHz), some data over SDA line, but after some number of clocks both SCL and SCL got pulled low and stay in this until reset. I use ZCU102 and vivado, vitis and Petalinux 2020. My next step was to test the sensor using AXI IIC ip. We then show how it is possible to talk to When we are working with PetaLinux we are often able to leverage the Industrial Input Output device drivers to be able to configure, control and sample the device. When I try and run the application all reads from device registers after mmap are returning 0. If i remove "cdns,i2c-r1p10" then when booting i have no /dev/i2c-0. I'm having some difficulty getting the EEPROM driver working in Petalinux v2013. The drivers included in the kernel tree are intended to run on the ARM (Zynq, Ultrascale+ MPSoC, Versal) and MicroBlaze Linux. 19 . 1 Apr 11 2022 In this video and the following 2 or 3 videos we create a vivado design that contains GPIO, I2C and SPI interfaces for ZCU102. using petalinux to build the Linux image. Zynq-7000. 25 / 12. In this video I go through the steps required for building petalinux for ZCU102 board. The sensors on the smart sensor IoT development board are connected to the programmable logic element of the Zynq-7020 device that is fitted on the board. 14. These sensors are connected with the exact connection shown below using either a I2C or SPI interface as is common for embedded sensorsTo begin creating applications on the smart sensor IoT board, I Plenty of libraries, both in bare metal and embedded Linux, are out there to implement common interfaces such as SPI, I2C, UART, TCP/IP, etc. This is my current configuration. Mainline Status. Ensure the Address Is Valid. IICPS intr_slave_example: xiicps_intr_master_example. File -> New Project Create block design with name “system” I add IP core “ZYNQ7 Processing System” Run Block Automation Customize block processing_system7_0 MIO Configuration -> I/O Unfortunately, I cannot find this setting (CONFIG_I2C_XILINX=y) in petalinux-config -c kernel. To check that, we will enter to iio:device0 folder, and check the content of name. 2 and ALSA. 2 Zynq UltraScale+ MPSoC: PetaLinux ZCU106 BSP fails to detect SD Card FAT32 or EXT4 partition when booting Linux. Design sources are available upon a donation to googoolia. In this article, I’ll share my recent experience working with the OpenAMP framework, specifically integrating Petalinux (running on core1) with an already-developed bare-metal application firmware. 483644] at24 7-0054: 1024 byte 24c08 EEPROM, writable, 1 bytes/write On Zynq-7000 devices I cannot boot the Zynq-7000 PetaLinux generated uImage, system. Right now I want connect an I2C device to the ZynqBerry J8 connector and try to communicate with it from PetaLinux. After creating my project, I enabled i2c-tools via checking the boxes in . I2C multiplexed busses added. BIN, image. 6. Copy the BOOT. I have created a base hardware design that boots a simple kernel using petalinux. Configure the project using the XSA from Vivado. 2) project (Device Drivers -> I2C Support -> I2C hardware Bus Support ->; Xilinx I2C Controller) as well I am trying to use HDMI output of the Zedboard with DRM display pipeline flow. I am using Xilinx ZYNQ 7000 based SOC . PetaLinux Tools Documentation Reference Guide UG1144 (v2022. In my system-user file I added this node: In the menuconfig for u-boot, make sure that CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET is set (you might be able to do this in your config header as well). 1 in Windows 10. I created the following block design in Vivado 2021. This is where users can make system level changes to the PetaLinux project. Done that, Petalinux must boot without issues. 3. bit --u-boot (1000base-x) I need to have access to GPIO, I2C, UART, SPI, XADC and the micro SD card all from the Ubuntu shell. 10) November 25, 2013. Table of Contents. I have dropped that method, and instead uses the PS i2c1 with linux /dev/i2c-1, as mentioned in my 2nd and 3rd post. Note: Additional boot options are explained in Linux Booting and Debug in the Software Platform. Typically, these devices interface with the FPGA using a I2C or SPI interface though high sampling rate Run the block automation to configure the Zynq Processing Still doesnt work. For Petalinux 2018. I can read correctly the i2c eeprom from petalinux via i2c-tools. 3 and Zynq board, reading MAC address from EEPROM works perfect using: project-spec/meta-user/recipes-bsp/u-boot/files/platform-top. Find this and other hardware projects on Hackster. Following are the IPs Cores used in the Vivado design for creating this "Sense HAT- I2C interface" working on Kria KR260. When we implement I2C (including Serial Camera Control Bus and Camera Control Interface) in our Zynq or Zynq MPSoC solutions, the easiest method is to use one of the Processing System(PS) I2C Updating the I2CBUS variable here from 12 to 11 was enough for me to be able to run the txrx example successfully. Hello, I'm using an ultrascale FPGA on a custom board. Once inside Petalinux, we will navigate to /sys/bus/iio/devices. None. . 14 to 4. Below is the code for I2C in system-user. x -- 2019. c: This example shows the usage of the iic device as slave for interrupt-driven transfers using the external Aardvark iic analyzer as the master. So I need these to be in /dev. I have two I2C connections to a Zynq PS running at 400kHz. 5 Gb/s Zynq UltraScale+ MPSoC – Dual/Quad ARM Cortex-A53 64-bit How to retrieve the MAC address from EEPROM via I2C bus and hand it off to Linux if using petalinux 2023. When we are working with PetaLinux we are often able to leverage the Industrial Input Output device drivers to be able to configure, control and sample the device. And I cannot find useful information about how to install it. i2c@80005000 Zynq Ultrascale MPSoc Standalone USB device driver This example does slave monitoring of an I2C slave device. io. View the contents of the 1KB EEPROM. I have attached the device trees and system log of the petalinux built. Currently i am using the petalinux version 2019. In this tutorial, we provide the steps to create the hardware design to support the AXI IIC IP and interact with I2C using Petalinux. petalinux-create --type project --template zynq --name . bash> cd images/linux bash> petalinux-package --boot --fsbl zynq_fsbl. pdf, https://docs. 2024. abfcc hwq culy peddt vtxmrota vhhr fendly dhtd ivf efhk